type, object hierarchy?

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Feb 4 02:32:07 EST 2008


Robert Kern <robert.kern at gmail.com> writes:

> And if you want to really blow your mind,
> 
> print isinstance(type, object)  # True
> print isinstance(object, type)  # True

Not what I see here.

Python 2.4.4 (#2, Jan  3 2008, 13:39:07)
[GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> issubclass(type, object)
True
>>> issubclass(object, type)
False

Python 2.5.2a0 (r251:54863, Jan  3 2008, 19:40:30)
[GCC 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> issubclass(type, object)
True
>>> issubclass(object, type)
False

-- 
 \              "Ignorance more frequently begets confidence than does |
  `\                                       knowledge." —Charles Darwin |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list