the below is what confuses me:
In terminal, I tried these codes:
>>> a = 1900
>>> b = 1900
>>> a is b
False
>>> c = 1
>>> d = 1
>>> c is d
True
As I think, these result comes from what I read from this post: what is difference between [None] and [] in python?: Python caches small integer objects for performance reasons. So 'a is b' will return false because they point to different objects (obviously they are not small integer objects).
But when I try this part of code on PyCharm venv, the result comes to different:
a = 1900
b = 1900
print(a is b)
console shows 'True'
Why does this happen? they have the same python version:
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 03:13:28)
[Clang 6.0 (clang-600.0.57)] on darwin