My understanding of "is" is that it checks if the two operands point to the same structure.
I am unsure why this is true
x = 1
y = 1
y is x
and why this is false
l1 = [1,2,3]
l2 = [1,2,3]
l1 is l2
Similarly, why is the first not false as well? Is it saying that when I initialize x, it creates the object with int value "1", and from now on, whenever I initialize variables to have "1", it will point to the first object.
If so, I am curious why its not the same with the second example.