PyDocs

Nav

Data Types

somenamedtuple._fields

collections

attribute
Tuple of strings listing the field names. Useful for introspection and for creating new named tuple types from existing named tuples.
1 Example
>>> p._fields            # view the field names
('x', 'y')

>>> Color = namedtuple('Color', 'red green blue')
>>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)
>>> Pixel(11, 22, 128, 255, 0)
Pixel(x=11, y=22, red=128, green=255, blue=0)
from the Python docs
See Also
No see-alsos for collections/somenamedtuple._fields
0 Notes
No notes for somenamedtuple._fields