[issue8206] 2to3 doesn't convert 'types.InstanceType' to 'object'

Martin v. Löwis report at bugs.python.org
Tue Mar 23 00:52:27 CET 2010


Martin v. Löwis <martin at v.loewis.de> added the comment:

In a sense, *all* objects are instances of new-style classes in 2.x, including instances of old-style classes (which are instances of the InstanceType type, which is a type, and hence a new-style class).

You may want to look at the __flags__ property of the type object. If it is a heap type, there is a good chance that it was created through a class statement. Alternatively, you can look at the type's __module__, and find out whether the module is a Python module.

----------

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


More information about the Python-bugs-list mailing list