type, object hierarchy?
Mel
mwilson at the-wire.com
Mon Feb 4 09:10:21 EST 2008
7stud wrote:
> On Feb 3, 10:28 pm, 7stud <bbxx789_0... at yahoo.com> wrote:
>> From the docs:
>>
>> issubclass(class, classinfo)
>> Return true if class is a subclass (direct or indirect) of classinfo.
>
>
> print issubclass(Dog, object) #True
> print issubclass(type, object) #True
> print issubclass(Dog, type) #False
Python 2.5.1 (r251:54863, Oct 5 2007, 13:36:32)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> issubclass (object, type)
False
>>> isinstance (object, type)
True
More information about the Python-list
mailing list