Is there a way to create a brand new object with canonic operations ? I am a bit confused by the example below :
x = 1
y = int.__new__(int, 1)
print x is y
>> True
EDIT :
“is” operator behaves unexpectedly with integers enlights the example above, but doesn't answer the question about the existence of a canonic way to create two different int
objects. In the end, it just helps to understand that writing x = 256; y = 256
is not a solution, which is not what I was looking for.