3 ms·
Named tuples have both field names and numeric indexes. If you iterate over a namedtuple, you just get the values. The field names are hidden in a _fields attri
by Kwpolska 3y ago
Named tuples have both field names and numeric indexes. If you iterate over a namedtuple, you just get the values. The field names are hidden in a _fields attribute, there is no way to iterate over (name, value) pairs.
- quietbritishjim 3y ago> there is no way to iterate over (name, value) pairs zip(x._fields, x) I get your point that it's not just a built in method though.