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 Nan Wu
Recipients Nan Wu
Date 2016-04-13.15:29:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460561340.28.0.563389556375.issue26747@psf.upfronthosting.co.za>
In-reply-to
Content
>>> import types
>>> a = 1
>>> isinstance(a, types.InstanceType)
False
>>> class A:
...     pass
... 
>>> a = A()
>>> isinstance(a, types.InstanceType)
True
>>> class A(object):
...     pass
... 
>>> a = A()
>>> isinstance(a, types.InstanceType)
False

Looks like isinstance(instance, types.InstanceType) only return True for user-defined old-style class instance. If it's the case, I feel doc should clarify that like what types.ClassType did. If no, someone please close this request. Thanks.
History
Date User Action Args
2016-04-13 15:29:00Nan Wusetrecipients: + Nan Wu
2016-04-13 15:29:00Nan Wusetmessageid: <1460561340.28.0.563389556375.issue26747@psf.upfronthosting.co.za>
2016-04-13 15:29:00Nan Wulinkissue26747 messages
2016-04-13 15:29:00Nan Wucreate