News for hackers. Stuff that matters.
Re:Redesigning Python's named tuples by Pxtl on Friday September 01, 2017 @10:58AM (#15148845)
The tuple was Python's answer to the C-Struct, really. If I want to duct-tape 4 values together and hand them around as 1, the convention was to use a tuple.

Tuples don't name values, but that's actually important for performance - Python is an old-fashioned dynamic language that still uses hashtable access for everything, but tuple indexing is a simple array offset. Considering Python's age, reducing that endlessly-nested series of hashtable hits was important back in the day.

There are no comments on this comment yet.