Message228649
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'> |
|
Date |
User |
Action |
Args |
2014-10-06 09:50:43 | martin.panter | set | recipients:
+ martin.panter, mark.dickinson, fhaxbox66@googlemail.com |
2014-10-06 09:50:43 | martin.panter | set | messageid: <1412589043.2.0.0440329602791.issue22563@psf.upfronthosting.co.za> |
2014-10-06 09:50:43 | martin.panter | link | issue22563 messages |
2014-10-06 09:50:42 | martin.panter | create | |
|