still struggling, howto use a list-element as a name ?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sat Jan 6 17:25:09 EST 2007


Stef Mientki a écrit :
 > rzed wrote:
(snip)

>> class Power_Supply(device):
>>     def __init__(self):
>>         self.pin = {
>>             0:dict(Name='GND',Value=_DIG_OUT,something=_par2),
>>             1:dict(Name='VCC',Value=_DIG_OUT,something=_par33),
>>         }
> 
> Why so complex, I need 10 or more parameters (or empty),

or empty ???

> and then this becomes completely unreadable.

Named parameters are way much readables than a 10+ tuple. No one is 
going to remember a 10+ list of params.

  > As this is part of the "user interface",
> (I want that completely unknown with Python people,
> write these lines),



More information about the Python-list mailing list