With the below code, I am getting the following error:
class C4(int):
def __init__(self,name1,name2):
self.name1=name1
self.name2=name2
When above code is executed, I get the error:
C4_inst=C4(3,6)
TypeError: int() can't convert non-string with explicit base
When I only use one parameter for__init__, I don't see the error. Can you please shed some light on why python would try to convert the parameters to int when the objective here is to instantiate C4 with 3,6.
I am trying to make C4 as the subclass to "int", so that i can use the operators defined for "int" type in Class C4.