3 ms·
> One interesting side-thing with list comprehensions Just to clarify, this is the behavior of py2 for loops in general, whether in a comprehension or not.
by chishaku 11y ago
> One interesting side-thing with list comprehensions
Just to clarify, this is the behavior of py2 for loops in general, whether in a comprehension or not.
- prlin 11y agoExcept dictionary comprehensions don't leak their variables.
- sophacles 11y agoProbably because dict comprehensions were introduced as a 3.0 feature, and put into 2.7 since that version is designed to be a bridge to 3.0. (They were actually proposed a long time ago, it was decided not to add them, but the decision changed to add them for 3.0)