Draft Pep (was: Re: Let's Talk About Lambda Functions!)
Hans Nowak
wurmy at earthlink.net
Tue Aug 6 00:12:44 EDT 2002
Paul Rubin wrote:
> Hans Nowak <wurmy at earthlink.net> writes:
>
>>>The above code passes 17 to a function which is not bound to any
>>>name.
>>
>>Really?
>>
>> >>> def define_twice():
>> def _twice(x):
>> return x + x
>> return _twice
>>
>> >>> define_twice()
>><function _twice at 0x00935678>
>>
>> >>> define_twice().func_name
>>'_twice'
>
>
> That's not a binding.
Maybe not, but it has a name, and can therefore hardly be called "anonymous".
Sure, the function is not bound to any name in the current local or global
namespaces. But it does have a name.
--
Hans (base64.decodestring('d3VybXlAZWFydGhsaW5rLm5ldA=='))
# decode for email address ;-)
The Pythonic Quarter:: http://www.awaretek.com/nowak/
More information about the Python-list
mailing list