[issue7390] inconsistent type return
Antoine Pitrou
report at bugs.python.org
Tue Nov 24 13:44:18 CET 2009
Antoine Pitrou <pitrou at free.fr> added the comment:
`instance` means it is an instance of an old-style class. Old-style
classes are classes which don't have `object` in their inheritance
hierarchy.
On the other hand, for instance new-style classes type() returns the
actual class.
Bottom line: this is by design. Of course in an ideal world (or in
Python 3) there are only new-style classes, but we had to maintain
compatibility, and that's why there are two slightly different object
models cohabiting in Python 2.x.
----------
nosy: +pitrou
resolution: -> invalid
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7390>
_______________________________________
More information about the Python-bugs-list
mailing list