Determine an object is a subclass of another

abcd codecraig at gmail.com
Tue Jan 9 09:33:25 EST 2007


How can tell if an object is a subclass of something else?

Imagine...

class Thing:
    pass

class Animal:
    pass

class Dog:
    pass

d = Dog()

I want to find out that 'd' is a Dog, Animal and Thing.  Such as...

d is a Dog
d is a Animal
d is a Thing

Thanks




More information about the Python-list mailing list