Analysis on the location of integer Object Storage in Python, and python integer
Python integer objects are stored in different locations. Some of them 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 support for the help house.