Temporary variables in list comprehensions

Paul Rubin no.email at nospam.invalid
Mon Jan 9 21:57:21 EST 2017


Ben Bacarisse <ben.usenet at bsb.me.uk> writes:
>   [(lambda tmp: (tmp, tmp+1))(expensive_calculation(x)) for x in data]

Nice.  The Haskell "let" expression is implemented as syntax sugar for
that, I believe.


More information about the Python-list mailing list