Lambda going out of fashion

Fredrik Lundh fredrik at pythonware.com
Thu Dec 23 06:02:10 EST 2004


Stephen Thorne wrote:

> Not true, you can't re-write
>
> def f():
>    raise ValueError, "Don't call f"

    f = lambda: eval(compile("raise ValueError(\"Don't call f\")", "", "exec"))

note that lambdas have names too, btw:

    print f.func_name
    <lambda>

</F> 






More information about the Python-list mailing list