[Python-ideas] Assignments in list/generator expressions

Nick Coghlan ncoghlan at gmail.com
Sun Apr 10 09:41:49 CEST 2011


On Sun, Apr 10, 2011 at 2:27 AM, Eugene Toder <eltoder at gmail.com> wrote:
> I'd rather add syntax equivalent to Haskell's let, than inventing
> completely new syntax. E.g. with name = expr. Original from the first
> post becomes
>
> ys = [y for x in xs with y = f(x) if y]
>
> but it's more flexible in general.

It isn't strangely missing at all, it's just hard:
http://www.python.org/dev/peps/pep-3150/

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list