Re: classes and list as parameter, whats wrong?




"Dirk Zimmermann" <python-list@xxxxxxx> wrote in message
news:20050826111532.GD23815@xxxxxxxxxxxxxxxxxxxxxxxxxxx
> But still, it is not absolutely clear for me, what is going on. So, at
> least just for my understanding: The parameter LL is created just once
> for the whole class and not for the object (because I del the object
> explicitly, which should destroy the object)?

Default parameter values are created (once) for the function, not for the
class or instance. Function default parameter expressions are evaluated
once and only once when the function is defined. Code that you want
evaluated with each call goes in the function body.

Terry J. Reedy



.



Relevant Pages