[issue14671] isinstance(obj, object) returns True for _old style_ class instances

Benjamin Peterson report at bugs.python.org
Fri Apr 27 06:13:08 CEST 2012


Benjamin Peterson <benjamin at python.org> added the comment:

2012/4/26 Q <report at bugs.python.org>:
> issubclass(obj.__class__, object)
>
> to be the official way to distinguish between the new-style and the old-style classes?

Just do type(cls) is types.ClassType.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14671>
_______________________________________


More information about the Python-bugs-list mailing list