3 ms·
Not OP. 2) From the doc [1]: > Named tuples assign meaning to each position in a tuple and allow for more readable, self-documenting code. They can be used wh
by iampims 10y ago
Not OP.
2) From the doc [1]:
> Named tuples assign meaning to each position in a tuple and allow for more readable, self-documenting code. They can be used wherever regular tuples are used, and they add the ability to access fields by name instead of position index.
They do act as immutable containers for related data. They are usually used to replace classes that don't have any behavior/methods.
They avoid confusion by having a name, and named attributes.
[1] https://docs.python.org/2/library/collections.html#collections.namedtuple https://docs.python.org/2/library/collections.html#collectio...