Why does use of a colon make difference to the result? And what should be the correct result?
# Not stored in a different location.
>>> id('123 4')== id('123 4')
True
# Also returns true
>>> x = '123 4'; y ='123 4'; id(x) == id(y)
True
But this same thing returns false.
>>> x = '123 4'
>>> y = '123 4'
>>> id(x) == id(y)
False
Same thing under function returns True
>>> def test():
... x = '123 4';y='123 4'; print (id(x)==id(y))
... a = '123 4'
... b='123 4'
... print (id(a)==id(b))
...
>>> test()
True
True