News for hackers. Stuff that matters.
Re:Redesigning Python's named tuples by gvx on Friday September 01, 2017 @01:26AM (#15146335)
Namedtuple is used a lot in the standard library to return struct-like results which used to be returned as an actual tuple, so making them non-indexable would break a lot of code, some of which was written before namedtuple even existed.
Re:Redesigning Python's named tuples by eesmith on Friday September 01, 2017 @04:06AM (#15146910)
I did that analysis a day ago when this topic came up previously, at https://news.ycombinator.com/item?id=15136961 .

There are 13 locations in the standard library where a namedtuple was used to replace a tuple, where making them non-indexable would break code.

There are 8 locations where it's used as a shorter way to write a simple class. My point in that thread was that namedtuple should never be used this way.

Re:Redesigning Python's named tuples by gvx on Friday September 01, 2017 @05:31AM (#15147166)
I think namedtuple is a terrible hack that never should have been (at least not this way), but changing it is going to be a PITA.