Finding in which class an object's method comes from

ast nomail at invalid.com
Thu Feb 4 03:25:59 EST 2016


Hi

Suppose we have:

ClassC inherit from ClassB
ClassB inherit from ClassA
ClassA inherit from object

Let's build an object:

obj = ClassC()

Let's invoke an obj method

obj.funct()

funct is first looked in ClassC, then if not found
on ClassB, then ClassA then object

But is there a command to know where funct is
found ?

Thx






More information about the Python-list mailing list