Gabriel Genellina wrote:
If you want a "frozen" function (that is, a function already set-up with
the parameters taken from the current values of x.a, x.b) use
functools.partial:
OK, that's also a nice idea.
Thanks!
Alan
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
You are now describing a function closure. Here is an example that
might help.
It does.
Thanks,
Alan
--
http://mail.python.org/mailman/listinfo/python-list
En Fri, 20 Feb 2009 16:49:21 -0200, Alan Isaac
escribió:
I have a class `X` where many parameters are set
at instance initialization. The parameter values
of an instance `x` generally remain unchanged,
but is there way to communicate to a method that
it depends only on the initial values of
Alan Isaac wrote:
I have a class `X` where many parameters are set
at instance initialization. The parameter values
of an instance `x` generally remain unchanged,
'Parameters' are the function local names in the header that get bound
to argument objects when the function is called. What you
I have a class `X` where many parameters are set
at instance initialization. The parameter values
of an instance `x` generally remain unchanged,
but is there way to communicate to a method that
it depends only on the initial values of these parameters
(and does not need to worry about any changes