From python in a nutshell,
Where C is a class, the statement
x=C(23)is equivalent to:x = C.__new__(C, 23) if isinstance(x, C): type(x).__init__(x, 23)
From my understanding object.__new__ creates a new, uninitialized instance of the class it receives as its first argument.
Why is there need to be a check with the isinstance(). Isn't it obvious that __new__ will return a object of type C.
If it is what happens if this test fails?
Since classes are callables, is the call to __new__ is done in the class's __call()__ method
Am I missing something here, please clarify this to me