Default Parameters to function!
Fredrik Lundh
effbot at telia.com
Wed Mar 15 16:13:13 EST 2000
Yuriy Gorvitovskiy <yuriy at centricsoftware.com> wrote:
> I want to make a request to the Python developers to change the way of
> default parameters initialization from "when function definition is
> executed" to "when function executed".
the default value can be an arbitrary expression, and it's
evaluated in the same context, and at the same time, as
the function or method definition itself. cannot be much
simpler, can it?
so if you want to change this, please explain:
-- in which context you want to evaluate the default value
expression
-- how to pass values between scopes
-- how to bind local values so they can be used in lambdas
-- how to handle exceptions in the default value expression
-- how to explain that python suddenly runs much slower
-- how to change this without breaking existing code
etc.
> I spend half of the days to figure out this problem.
hint: reading the FAQ can help:
http://www.python.org/doc/FAQ.html#6.25
</F>
More information about the Python-list
mailing list