ID EN
Collections

_asdict

Python 3.11

Return a new dict which maps field names to their corresponding values:

Syntax

PYTHON
somenamedtuple._asdict()

Examples

Example 1
PYTHON
>>> p = Point(x=11, y=22)
>>> p._asdict()
{'x': 11, 'y': 22}

See Also

dict OrderedDict dict dict OrderedDict OrderedDict