Skip to content

Instantly share code, notes, and snippets.

@karlicoss
Created April 8, 2016 22:26
Show Gist options
  • Save karlicoss/2197116446d08c372ada20de3c5b7bc6 to your computer and use it in GitHub Desktop.
Save karlicoss/2197116446d08c372ada20de3c5b7bc6 to your computer and use it in GitHub Desktop.
Python id() wtf
l = [4, 5, 6]
l2 = [1, 2, 3]
print(id(l))
print(id(l2))
print("--------")
print(id([4, 5, 6]))
print(id([1, 2, 3]))
# Result:
# 140236733799304
# 140236733799368
# --------
# 140236733800136
# 140236733800136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment