Why I have problem creating a class the inherite from str (or also int)
class C(str):
def __init__(self, a, b):
str.__init__(self,a)
self.b = b
C("a", "B")
TypeError: str() takes at most 1 argument (2 given)
tha same happens if I try to use int
instead of str
, but it works with custom classes. I need to use __new__
instead of __init__
? why?