Stef Mientki a écrit : > How can I list a type of an object instance ? > > I tried: > > class tLED (tDevice):
<ot> Do yourself (and the world) a favour and give up hungarian notation... This should be: class Led(Device): #... </ot> > def some_proc(self): > print 'type(self)', type(self) > > But i gives me: > type(self) <type 'instance'> looks like Device is an old style class. > Moreover, I want even the type to be listed by it's ancestor, like this > > class tDevice: > def some_other_proc: > print 'type(self)', type(self) Try this: class Device(object): def some_other_proc(self): print self, type(self) class Led(Device): pass led = Led() led.some_other_proc() -- http://mail.python.org/mailman/listinfo/python-list