[Python-ideas] Assignments in list/generator expressions

Eugene Toder eltoder at gmail.com
Sun Apr 10 15:31:53 CEST 2011


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

Local definition in list comprehension is significantly simpler that
'given'. Semantically, 'with name = expr' can be treated as a more
readable form of 'for name in [expr]'. Implementation can use a simple
assignment.

Eugene



More information about the Python-ideas mailing list