Problems with Python3.6 int optimization mechanism, 64-bit machines (-5 to 257)
ringa_lee
ringa_lee 2017-05-18 10:54:54
0
1
587

Optimization mechanism in python (both 2.7 and 3.5):
Numbers between -5~257, if you use the first assignment method, then they still belong to the same memory.
But the test code I wrote on my local machine is as follows:

Result

#This is inconsistent with the above.

Then I tested it on the compiler on the Python official website and it was correct


I would like to ask what is the cause of this. . .

ringa_lee
ringa_lee

ringa_lee

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!