4 ms·
Python 2 actually did let comprehension variables leak out into the surrounding scope. They changed it for Python 3, presumably because it was too surprising to
by bobbylarrybobby 1y ago
Python 2 actually did let comprehension variables leak out into the surrounding scope. They changed it for Python 3, presumably because it was too surprising to overwrite an existing variable with a comprehension variable.
- dapperdrake 1y agoThat almost sounds like having the "variables" eax, ebx, ecx, and edx.
- dec0dedab0de 1y agoOh wow, maybe that's why I expect it to work that way! I can't believe it's been long enough since I used 2 that I'm forgetting it's quirks.