question about what lamda does

grebekel at gmail.com grebekel at gmail.com
Tue Jul 18 13:25:20 EDT 2006


I stand corrected. Not sure where I got that from, improper
defragmentation due to sleep depravation perhaps...

K.S.Sreeram wrote:
> grebekel at gmail.com wrote:
> > The two primary differences between using def and using lambda is that
> > lambda is limited to a single expression and def cannot be used within
> > another function.
>
> 'def' can certainly be used within another function :
>
> def make_adder( delta ) :
>     def adder( x ) :
>         return x + delta
>     return adder
>
> [sreeram;]
>
>
> --------------enigFDB411206B54B101CC680F5A
> Content-Type: application/pgp-signature
> Content-Disposition: inline;
> 	filename="signature.asc"
> Content-Description: OpenPGP digital signature
> X-Google-AttachSize: 253




More information about the Python-list mailing list