Would Anonymous Functions Help in Learning Programming/Python?
Delaney, Timothy (Tim)
tdelaney at avaya.com
Mon Sep 24 06:35:36 EDT 2007
Carsten Haese wrote:
>> Where the heck does *this* come from? Neither Python 2.5.1 nor the
>> 3.0alpha has this in `__builtin__`.
>
> It comes from the 'new' module:
>
>>>> import new
>>>> help(new.function)
> Help on class function in module __builtin__:
> ...
>
> Oddly enough, the help misrepresents which module the function is
> coming from.
Not exactly:
>>> help(type(lambda x: x))
Help on class function in module __builtin__:
The function type is builtin, but it doesn't have an exposed name.
`new.function` is simply a name bound to the function type.
Note the help says *class* function ...
Tim Delaney
More information about the Python-list
mailing list