The following small series will give you an analysis of the location of integer Object Storage in Python. I think this is quite good. Now I will share it with you and give you a reference. Let's take a look at the location where Python integer objects are stored, some are stored in a certain storage, while others are used to open up space.
For the reason of this sentence, you can look at the following code:
A = 5b = 5a is B # Truea = 500b = 500a is B # False
The code above shows that integer 5 always exists, while integer 500 never exists.
Which integers are stored all the time?
A, B, c = 0, 0, 0 while a is B: I + = 1a, B = int (str (I), int (str (I) else: print (I) # print 257
As we know, non-negative integers smaller than or equal to 256 (2 ** 8) are always stored.
A =-1b =-1a is B # False
Negative numbers are not stored all the time.
In the above analysis, the location of integer Object Storage in Python is all the content shared by xiaobian. I hope to give you a reference, and I hope you can support your own home.