mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #25628: Make namedtuple "rename" and "verbose" parameters keyword-only.
This commit is contained in:
parent
3ee933f1c3
commit
6538b430cf
4 changed files with 22 additions and 3 deletions
|
@ -353,7 +353,7 @@ _field_template = '''\
|
|||
{name} = _property(_itemgetter({index:d}), doc='Alias for field number {index:d}')
|
||||
'''
|
||||
|
||||
def namedtuple(typename, field_names, verbose=False, rename=False):
|
||||
def namedtuple(typename, field_names, *, verbose=False, rename=False):
|
||||
"""Returns a new subclass of tuple with named fields.
|
||||
|
||||
>>> Point = namedtuple('Point', ['x', 'y'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue