better lambda support in the future?

Fredrik Lundh fredrik at pythonware.com
Fri Dec 17 15:47:42 EST 2004


Steven Bethard wrote:

> Even if you could settle the syntax issue, once you've decided that you really do need a true 
> block in an anonymous function, you're not really saving much space by not declaring it:
>
> def f(*args):
>     # body line 1
>     # body line 2
>     # ...
>     # body line N
> x = func or f
>
> v.s.
>
> x = func or lambda *args:
>                 # body line 1
>                 # body line 2
>                 # ...
>                 # body line N

you meant:

    def x(*args):
        # body line 1
        # body line 2
        # ...
        # body line N

    v.s.

    x = func or lambda *args:
        # body line 1
        # body line 2
        # ...
        # body line N

right?

</F> 






More information about the Python-list mailing list