Draft Pep (was: Re: Let's Talk About Lambda Functions!)
fakeaddress at nowhere.org
Mon Aug 5 18:18:34 CEST 2002
John Roth wrote:
>>Contrary to popular belief, lambda did not add anoymous functions to
>>Python. Python had them even without lambda.
>> def _twice(x):
>> return x + x
>> return _twice
>>The above code passes 17 to a function which is not bound to any name.
> It is bound to a name. Specifically, it's bound to _twice. The
> fact that the name is part of the function's scope, and not the
> enclosing class or module scope doesn't make it not a name!
Check the rules on local variables. The function was, at one
time, bound to the name _twice. Nevertheless, the above code
passes 17 to a function that is not bound to any name.
More information about the Python-list