On 27/02/23 10:07 pm, Roel Schroeven wrote:
I'm guessing you're thinking about variables leaking out of list comprehensions. I seem to remember (but I could be wrong) it was a design mistake rather than a bug in the code, but in any case it's been fixed now (in the 2 to 3 transition, I think).
The semantics of list comprehensions was originally defined in terms of nested for loops. A consequence was that the loop variables ended up in the local scope just as with ordinary for loops. Later it was decided to change that. -- Greg -- https://mail.python.org/mailman/listinfo/python-list