listing the type of an object

Stef Mientki S.Mientki-nospam at mailbox.kun.nl
Wed Jun 27 17:12:26 EDT 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)

thanks,
Stef Mientki




More information about the Python-list mailing list