[Python-Dev] Please Vote -- Generator Comprehensions (original) (raw)
Martin v. Loewis martin@v.loewis.de
07 Mar 2002 09:09:17 +0100
- Previous message: [Python-Dev] Please Vote -- Generator Comprehensions
- Next message: [Python-Dev] Please Vote -- Generator Comprehensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Samuele Pedroni" <pedroni@inf.ethz.ch> writes:
Given that a frame, new scope and nested scope semantics is required the rewriting as a generator is probably the strategy, although I don't know whether the CPython internal syntax trees allow for a direct rewriting strategy.
In turn, the bytecode for this will involve another code object, as well as a MAKE_FUNCTION execution, cell objects, and the like. My gut feeling is that many people will be surprised by the poor performance of generator comprehension, compared to list comprehension. They also might be surprised when they get cyclic garbage they didn't expect, but I'm not sure under what circumstances this might happen.
Regards, Martin
- Previous message: [Python-Dev] Please Vote -- Generator Comprehensions
- Next message: [Python-Dev] Please Vote -- Generator Comprehensions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]