Python lists are so “leaky”
stackoverflow.com
stackoverflow.com
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.