Skip to content

Instantly share code, notes, and snippets.

@mjpieters
Created September 21, 2013 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjpieters/6650955 to your computer and use it in GitHub Desktop.
Save mjpieters/6650955 to your computer and use it in GitHub Desktop.
>>> a = [1, 2]
>>> a_multiply = [a] * 5
>>> a_comp = [a for _ in range(5)]
>>> all(i is a for i in a_multiply)
True
>>> all(i is a for i in a_comp)
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment