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 pwaller
Recipients pwaller
Date 2010-01-27.16:11:07
SpamBayes Score 0.04533424
Marked as misclassified No
Message-id <1264608669.85.0.379125118171.issue7796@psf.upfronthosting.co.za>
In-reply-to
Content
Apologies if there is a way of doing this, but I haven't been able to find anything.

I need to be able to do the following:

my_tuple = namedtuple("my_tuple", "a b c")
obj = my_tuple(1,2,3)

if isinstance(obj, namedtuple):
    .. do stuff ..

The best I could come up with for the moment is:

if isinstance(obj, tuple) and type(obj) is not tuple:
    .. do stuff ..
History
Date User Action Args
2010-01-27 16:11:09pwallersetrecipients: + pwaller
2010-01-27 16:11:09pwallersetmessageid: <1264608669.85.0.379125118171.issue7796@psf.upfronthosting.co.za>
2010-01-27 16:11:08pwallerlinkissue7796 messages
2010-01-27 16:11:08pwallercreate