Message263338
>>> 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. |
|
Date |
User |
Action |
Args |
2016-04-13 15:29:00 | Nan Wu | set | recipients:
+ Nan Wu |
2016-04-13 15:29:00 | Nan Wu | set | messageid: <1460561340.28.0.563389556375.issue26747@psf.upfronthosting.co.za> |
2016-04-13 15:29:00 | Nan Wu | link | issue26747 messages |
2016-04-13 15:29:00 | Nan Wu | create | |
|