What is "lambda x=x : ... " ?

Mike Meyer mwm-keyword-python.b4bdba at mired.org
Thu Jan 10 20:41:35 CET 2008

On Thu, 10 Jan 2008 19:59:23 +0100 Fredrik Lundh <fredrik at pythonware.com> wrote:
> Mike Meyer wrote:
> >> What does "y=y" and "c=c" mean in the lambda function?
> > 
> > Older versions of python didn't make variables in an outer scope
> > visible in the inner scope. This was the standard idiom to work
> > around that.
> lexically scoped free variables and object binding are two different 
> things, and have different semantics.  the former does not always 
> replace the latter.



Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

More information about the Python-list mailing list