listing the type of an object

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Thu Jun 28 11:42:30 EDT 2007


Neil Cerutti a écrit :
> On 2007-06-28, Bruno Desthuilliers <bruno.42.desthuilliers at wtf.websiteburo.oops.com> 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):
>>     #...
> 
> Using a naming convention for class objects, e.g., camel-case, is
> a practice very similar to hungarian notation.

And it's not even totally consistant since builtin types are usually 
lowercase. But it's still the convention.

> I would've said something like: start learning the Python
> community's naming conventions, and use those instead of
> inventing your own.

The TMyType convention comes from Delphi. So let's make this:

"""
start learning the Python
community's naming conventions, and use those instead of the ones of 
your usual language
"""

!-)




More information about the Python-list mailing list