type, object hierarchy?
I V
ivlenin at gmail.com
Mon Feb 4 01:31:33 EST 2008
On Sun, 03 Feb 2008 21:31:44 -0800, 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
So Dog is a subclass of object
> print issubclass(type, object) #True
and type is also a subclass of object. But
print issubclass(object, type) # False
so
> print issubclass(Dog, type) #False
which is what you would expect - Dog is a subclass of object, and object
isn't a subclass of type, so Dog isn't a subclass of type either.
More information about the Python-list
mailing list