Georg Brandl wrote:
> Greg Ewing schrieb:
>> Phillip J. Eby wrote:
>>> This looks like a bug to me. A list comprehension's local scope
>>> should be the locals of the enclosing code, even if its loop indexes
>>> aren't exposed to that scope.
>> It sounds like list comprehensions are being implem
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Georg is correct. A list comprehension like:
|
| [(x * y) for x in seq1 for y in seq2]
|
| expands to the following in 2.x (% prefixes the compiler's hidden
| variables):
|
| %n = []
| for x in seq1:
| for y in s
Reference Implementation
If this PEP is accepted, the author will provide a reference
implementation of the new classes in pure Python (that can run in
CPython, PyPy, Jython and IronPython) and a second one optimized for
speed in Python and C, suitable for inclusion in th
Terry Reedy wrote:
> "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> | In py3k it expands to:
> |
> | def (outermost):
> | %0 = []
> | for x in outermost:
> | for y in seq2:
> | %0.append(x*y) # Special opcode, not a normal call
> | return