list extension ?

Stef Mientki stef.mientki at gmail.com
Mon Jun 30 21:05:10 CEST 2008


thanks guys,
>
>>    def __init__ ( self, value = [] ) :
>
> Gotcha : default argument values are eval'd only once. Also, it would 
> make more sense IMHO to follow the parent's class initializer's 
> behaviour:
>
>     def __init__(self, *args)
>
>>        list.__init__ ( self, value )
>
>          list.__init__(self, *args)
>
that's even better, except the call must be
         list.__init__ ( self, args )

cheers,
Stef



More information about the Python-list mailing list