Код: Выделить всё
class StrSubClass(str) :
def __init__(self, s) :
super().__init__(s)
Код: Выделить всё
StrSubClass("foobar")Код: Выделить всё
File ".../foo.py", line 3, in __init__
super().__init__(s)
TypeError: object.__init__() takes exactly one argument (the instance to initialize)
Код: Выделить всё
class ListSubClass(list) :
def __init__(self, l) :
super().__init__(l)
Код: Выделить всё
>>> ListSubClass( [1,2,3] )
[1, 2, 3]