From my understanding, if a variable of an immutable type is assigned a value equal to another variable of the same immutable type, they should both be referencing the same object. I am using Python 2.7.6, don't know if this is a bug.
This behaves like I how understood:
x = 'ab'
y = 'ab'
id(x) == id(y)
True
However, by altering a character, this does not behave:
x = 'a#'
y = 'a#'
id(x) == id(y)
False
Strangely though, parallel assignment is very different!
x, y = 'a#','a#'
id(x) == id(y)
True
I do not understand this behavior.