Created
October 18, 2015 19:21
-
-
Save multivac61/6e02f88b3a7816975d98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'This is an example of list comprehension control variables being leaked to their outer scope' | |
for i in range(10): | |
a = [i for i in range(43)] | |
print i # will print 42 every time! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment