

Python lists are so “leaky” - orkohunter
http://stackoverflow.com/q/31218826/4698026

======
dalke
The link that isn't user tagged is
[http://stackoverflow.com/questions/31218826/unexpected-
outpu...](http://stackoverflow.com/questions/31218826/unexpected-output-from-
listgenerator) .

The short version is that under Python 2.x, "[1 for x in range(5)]" will
'leak' the variable and value for 'x' outside of the list comprehension. This
mistake was not repeated for generator comprehensions, and is one of the many
things that were fixed under Python 3.x.

