Skip to content

Instantly share code, notes, and snippets.

@benjamingeiger
Created July 25, 2013 18:31
Show Gist options
  • Save benjamingeiger/6082446 to your computer and use it in GitHub Desktop.
Save benjamingeiger/6082446 to your computer and use it in GitHub Desktop.
Aliasing bug in Python.
foo = [[0] * 10] * 10
print(foo)
foo[3][5] = 1
print(foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment