-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Labels
Description
- the _fields attribute enables to detect classes defined with the collections.namedtuple factory method, its keys are the class attributes
- the attributes are not typed: specify any or don't specify one
from collections import namedtuple
Circle = namedtuple('Circle', ['x', 'y', 'radius'], defaults=[1])
# Circle._fields: ('x', 'y', 'radius')
# Circle._fields_defaults: {'radius': 1}