I'm using PyCharm 2016.1.3 Community edition.
When the code below is copied to python console as block, variables 'a' and 'b' are the same objects
>>> a = 1000
b = 1000
print (a is b)
True
>>> id(a)
36079236
>>> id(b)
36079236
But in this case, when entering code line by line, both variables are different objects
>>> a = 1000
>>> b = 1000
>>> print (a is b)
False
Could it be that in the first case PyCharm doing some kind of optimization here?
Thanks for help