jython - why '==' return true but 'is' return false

192 Views Asked by At

I am start use jython2.7.0 now, but there has little different between python2.7.15.

for example, In python

a = "hello", b = "hello", "a is b" and "a == b" will return True.

but In jython2.7.0 "a is b" return False, "a == b" return True, does anyone knows why ??

>>>jython
>>>
>>>a = "hello"
>>>b = "hello"
>>>
>>>a is b
>>>False
>>>
>>>a == b
>>>True
>>>
>>>a = 1
>>>b = 1
>>> a is b
>>>True
0

There are 0 best solutions below