I understand that when I do:
>>> int(4.0)
>>> int('10')
The __init__()
method from the class of the argument (in the example, float
and str
, respectively), will be called.
I wonder what will happen if I do int()
, I mean, without any argument. It wont call __int__()
from class NoneType
, because it doesn't implement that method.
What will happen?
Also, does this mean I can only directly call the constructor of class int
if the argument is an int
?
Thanks,