Named tuples

Jeff Shannon jeff at ccvcorp.com
Wed Nov 17 20:13:45 EST 2004


Carlos Ribeiro wrote:

>4. Named attribute access is supported by __getattr__. Names are
>looked up on the magic __names__ attribute of the tuple.
>
>5. On slicing, a named tuple should return another named tuple. This
>means that the __names__ tuple has to be sliced also.
>  
>

Hm.  If __names__ is a tuple, then does that tuple have a __names__ 
attribute as well?

(In practice, I can't imagine any reason why tuple.__names__.__names__ 
should ever be anything other than None, but the potential recursiveness 
makes me nervous...)

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list