listing the type of an object

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Jun 28 12:20:44 CEST 2007


stef a écrit :
> Bruno Desthuilliers wrote:
>> 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>
> Didn't know that this was called "Hungarian notation",
> and although it's not my personal favorite, it is thé standard in Delphi,

Yeps. I know. But Python is not Delphi.

> but I admit that it's not a very good choice in a object oriented 
> language like Python.

MHO is that it's not a very good choice, period. But that's another 
troll !-)

> The program I'm writing now is might be an exception,
> I'm writing a program that should be extended by non-Python-programmers,
> even maybe non-programmers !

AFAICT, lots of "non-programmers" are using Python.

> So I'm trying to use a simplest approach from the viewpoint of the end 
> users.

I think the simplest approach is to use the simplest possible naming 
scheme. Which is to stick to the idiomatic naming conventions, most of 
them described in pep08.

My 2 cents...



More information about the Python-list mailing list