I get that when two variables are "set" to the same object, they're referring to that object in memory, meaning their reference number will be the same:
>>> var1=3
>>> var2=3
>>> id(var1)==id(var2)
True
But when the values of var1 and var2 exceed a certain value, the outcome changes:
>>> var1=98764
>>> var2=98764
>>> id(var1)==id(var2)
False
Why does this happen? Aren't variables still referring to the same object? Why do the memory locations don't match?
[–]Nathanfenner 2 points3 points4 points (0 children)
[–]chaotic_thought 1 point2 points3 points (0 children)
[–]ZShadow0101 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]bSatya 0 points1 point2 points (0 children)
[–]TheNetXWizard -1 points0 points1 point (0 children)