Re: classes and list as parameter, whats wrong?
- From: "Terry Reedy" <tjreedy@xxxxxxxx>
- Date: Fri, 26 Aug 2005 17:07:18 -0400
"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
.
- Prev by Date: Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type
- Next by Date: Re: Language translation possible in python?
- Previous by thread: Re: classes and list as parameter, whats wrong?
- Next by thread: Re: classes and list as parameter, whats wrong?
- Index(es):
Relevant Pages
|