Skip to content

Instantly share code, notes, and snippets.

@macintux
Created November 28, 2017 02:51
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 macintux/3fabcd1d9e78fe98cf6b355aad19ffea to your computer and use it in GitHub Desktop.
Save macintux/3fabcd1d9e78fe98cf6b355aad19ffea to your computer and use it in GitHub Desktop.
THIS IS WHY I HATE MUTABILITY
>>> head = 9
>>> ranks = [9, 8, 7, 6, 5]
>>> range(head, head-5, -1)
[9, 8, 7, 6, 5]
>>> range(head, head-5, -1) == ranks
True
>>> ranks.pop(0)
9
>>> ranks.pop(0) == 9
False
>>> ranks
[7, 6, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment