namedtuple is a data structure provided by the Python collections module. It enables the creation of tuples with named elements (e.g., a Student tuple with the values (name, school, age) rather than a tuple with just two strings and an integer).
namedtuple
is a data structure provided by the Python collections
module. It enables the creation of tuples with named elements (e.g., a Student tuple with the values (name
, school
, age
) rather than a tuple with just two strings and an integer).
Documentation: collections module in Python 3.
Recently, a declarative API for namedtuples is also provided by the typing
module.