Instance attributes vs method arguments

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Tue Nov 25 10:45:12 EST 2008


M.-A. Lemburg a écrit :
(snip)
> It is always good practice to provide default values for
> instance variables in the class definition, both to enhance
> readability and to allow adding documentation regarding
> the variables, e.g.

Your opinion. As far as I'm concerned, using class variables this way is 
more of a WTF than a "good practice".

> class Class_a:
> 
>    # Foo bar
>    a = None
> 
>    # Foo baz
>    b = None
> 
>    ...
> 



More information about the Python-list mailing list