Stef Mientki wrote:
> 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)
> 

Ahhh, history. At the moment (that is in  2.2 <= Python Version < 3.0 ),
there are two types of classes: old-style classes are the default and a
load of WTF?, which new-style classes make sense and behave like you
(that is "one" in general and you, Stef, in particular) expect.

As I'm too lazy to explain what all this is about, I'll point you to a
page with a promising title:

http://wiki.python.org/moin/NewClassVsClassicClass

Thomas Jollans

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to