[Python-ideas] A comprehension scope issue in PEP 572

Tim Peters tim.peters at gmail.com
Sat May 12 18:28:14 EDT 2018


Ah, fudge - I pasted in the wrong "high-level" code.  Sorry!  The code
that's actually being emulated is not

> list(i + sum((i := i+1) + i for j in range(i))
>       for i in range(5))

but

     list(i + sum((i := i+1) for j in range(i)) + i
          for i in range(5))

> ...

I have piles of these, but they're all equally tedious so I'll stop
with this one ;-)


More information about the Python-ideas mailing list