<分区>
来自 this link我了解到
The current implementation keeps an array of integer objects for all integers between -5 and 256, when you create an int in that range you actually just get back a reference to the existing object
但是当我尝试为我的 session 提供一些示例时,我发现它在赋值和元组解包方面的行为不同。
这是片段:
>>> a,b = 300,300
>>> a is b
True
>>> c = 300
>>> d = 300
>>> c is d
False