Skip to content

Instantly share code, notes, and snippets.

@tristaaan
Last active May 20, 2018 23:28
Show Gist options
  • Save tristaaan/9df6fbb9b0af79114dc5d15a902f1354 to your computer and use it in GitHub Desktop.
Save tristaaan/9df6fbb9b0af79114dc5d15a902f1354 to your computer and use it in GitHub Desktop.
def evil_gen():
a = [0, 0, 0, 0, 0]
while 1:
for i in range(10):
for j in range(5):
a[i] = [i+1]
yield (a)
def good_gen():
while 1:
for i in range(10):
a = [0, 0, 0, 0, 0]
for j in range(5):
a[i] = [i+1]
yield (a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment