question about what lamda does

K.S.Sreeram sreeram at tachyontech.net
Tue Jul 18 11:50:56 EDT 2006


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;]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20060718/d1fda997/attachment.sig>


More information about the Python-list mailing list