Steve Jorgensen wrote:
I feel like this proposal is not quite right, but maybe the idea will provoke some thoughts about something similar that -would- be right. The idea first came to me upon realizing that since namedtuple classes have no special base class beyond tuple, there should be some way of identifying them as being primarily structural, even though they are instances of tuple which, in other cases, usually means something that is primarily sequential. It is easily possible to identify a namedtuple by checking to see whether it has an _asdict method, but it might be nice to formalize the way that struct-like objects are identified in a virtual base class and be something that had application beyond just checking whether a tuple is a namedtuple.
Along with this idea, maybe `namedtuple` should became a type (not just a callable as it is now) for classes produced by calling `namedtuple()`. The `namedtuple` type could in turn inherit from `tuple` and from `Record` (or `Struct` or whatever name is decided for that).