PEP 289: Generator Expressions (please comment)
Inyeol Lee
inyeol.lee at siimage.com
Wed Oct 29 14:26:42 EST 2003
On Fri, Oct 24, 2003 at 05:42:44AM -0700, Chris Perkins wrote:
> In fact, list comprehensions themselves become redundant syntactic
> sugar under the new proposal:
>
> [foo(x) for x in bar] ==> list(foo(x) for x in bar)
Is there any plan to deprecate list comprehension when we move to
Python3.0? I think the advantages are;
1. It's just a syntactic sugar, only saves 4 chars.
2. It solves loop variable leaking problem of list comprehension.
I think it causes less confusion to remove list comprehension than
to change the semantics of it not to leak loop variables when 3.0 comes.
3. We can
More information about the Python-list
mailing list