Home

chris.monsanto@gmail.com wrote:
> There are already anonymous functions in Python.
>
> lambda x, y, z: x + y + z
>
> is the same as:
>
> def _(x, y, z): return x + y + z

They are the same only in special cases:

The special identifier "_" is used in the interactive
interpreter to store the result of the last evaluation; it
is stored in the __builtin__ module. When not in interactive
mode, "_" has no special meaning and is not defined.
[Python Reference Manual; 2.3.2 Reserved classes of
identifiers. http://docs.python.org/ref/id-classes.html]


--
--Bryan

previous
next

Re: Python in Chinese
Re: Sorting lists by struct member variables
Re: (no) fast boolean evaluation ?
Segmentation Fault On Program Termination?
Re: Recursive Search
Podaruj Zycie
Fundacja Iskierka
Fundacja Hobbit
Dzieci Niczyje
Nasze Dzieci