Weird Python Integers

from blog Kate Murphy, | ↗ original
Note: all of this code was run on my machine using Python 3.6.1. Not everything will work the same if you test using Python 2. >>> a = 42 >>> b = 42 >>> a is b True >>> a = 316 >>> b = 316 >>> a is b False That is suprising! It turns out that all “small integers” with the same value point to the same memory. We can use the Python built-in...