[Python-Dev] Re: PEP 289 - Generator Expressions - Let's MoveForward

Tim Peters tim.one at comcast.net
Fri Apr 30 18:20:55 EDT 2004

>> Listcomps can be deprecated, although not all existing uses of listcomps
>> will translate directly into genexps.

[David Eppstein]
> Not all?  When would [listcomp] ever not be replaceable by list(gencomp)?

The point of Armin's original msg in this thread was that direct replacement
can have different semantics.  Applying a transformation (via list()) is a
different story, although I expect someone obsessed enough could concoct an
example that worked differently, because genexp guts truly live in a
different scope than listcomp guts (e.g., play games with locals()).

More information about the Python-Dev mailing list