Martin Panter added the comment:

Perhaps Leo doesn’t understand that the name passed to “namedtuple” is just an 
indicator for debugging etc, and it doesn’t really have to be unique or even 
correspond with what it is assigned to. I do remember finding it a bit odd that 
I had to give it a name when I first used “namedtuple”, but I guess it is 
because all Python function and class objects store their name internally.

>>> AB = namedtuple("Whatever", ("a", "b"))
>>> AB
<class '__main__.Whatever'>
>>> Whatever
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'Whatever' is not defined
>>> Whatever = AB
>>> Whatever
<class '__main__.Whatever'>

----------
nosy: +vadmium

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22563>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to