listing the type of an object

Stef Mientki S.Mientki-nospam at
Wed Jun 27 23:12:26 CEST 2007

How can I list a type of an object instance ?

I tried:

class tLED (tDevice):
   def some_proc(self):
     print 'type(self)', type(self)

But i gives me:
   type(self) <type 'instance'>

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)

Stef Mientki

More information about the Python-list mailing list