This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients fhaxbox66@googlemail.com, mark.dickinson, martin.panter
Date 2014-10-06.11:06:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412593599.62.0.590857893685.issue22563@psf.upfronthosting.co.za>
In-reply-to
Content
Right; the underlying problem of having objects that appear to be instances of  the wrong class has nothing to do with namedtuples.  After this sequence:

>>> class A: pass
... 
>>> a = A()
>>> 
>>> class A: pass
... 

We get the following somewhat confusing results:

>>> type(a)
<class '__main__.A'>
>>> A
<class '__main__.A'>
>>> isinstance(a, A)
False

Class factories like namedtuple make it somewhat easier to run into this issue, but it's nothing really to do with namedtuple itself, and it's not something that could be "fixed" without significant language redesign.
History
Date User Action Args
2014-10-06 11:06:39mark.dickinsonsetrecipients: + mark.dickinson, fhaxbox66@googlemail.com, martin.panter
2014-10-06 11:06:39mark.dickinsonsetmessageid: <1412593599.62.0.590857893685.issue22563@psf.upfronthosting.co.za>
2014-10-06 11:06:39mark.dickinsonlinkissue22563 messages
2014-10-06 11:06:39mark.dickinsoncreate