Skip to content

Support default values for collections.namedtuple? #4788

Closed
@ilevkivskyi

Description

@ilevkivskyi

Python 3.7 adds support for specifying default values in call to collections.namedtuple, see python/cpython#4859. So for example this is valid:

from collections import namedtuple

NT = namedtuple('NT', ('x', 'y'), defaults=(0, 0))
NT()
NT(1)
NT(1, 2)

Should we support this, or supporting default values for typing.NamedTuple (already implemented) is enough?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions