Lambda going out of fashion

Fredrik Lundh fredrik at pythonware.com
Thu Dec 23 12:02:10 CET 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