2 ms·
Can you expand on 1 and 2?
by mrfusion 10y ago
Can you expand on 1 and 2?
- iampims 10y agoNot 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...