Optional parameter object re-used when instantiating multiple objects

alex23 wuwei23 at gmail.com
Fri Nov 21 00:54:29 CET 2008


On Nov 20, 10:42 pm, Aaron Brady <castiro... at gmail.com> wrote:
> At first, I would expect it to define them at compile-time.  Then,
> when I learned there was no such thing, I would expect it to define
> them at execute-time.  What does that have to do with evaluating a
> default argument?

It has -everything- to do with it when we're talking about the
defining of functions, and certainly a lot more relevance than straw
man arguments on the behaviour of browser buttons.

You said that you "would expect it to define them at execute-time". So
is that when the interpreter first hits the def or when the
interpreter hits every single function call? Because I personally
consider it to clearly occur at the point of definition and not at the
point of calling.



More information about the Python-list mailing list