Why can't I subclass tuple in python3?
问题 Let's preface this question by saying that you should use __new__ instead of __init__ for subclassing immutable objects. With that being said, let's see the following code: class MyTuple(tuple): def __init__(self, *args): super(MyTuple, self).__init__(*args) mytuple = MyTuple([1,2,3]) This works in python2, but in python3 I get: Traceback (most recent call last): File "tmp.py", line 5, in <module> mytuple = MyTuple([1,2,3]) File "tmp.py", line 3, in __init__ super(MyTuple, self).__init__(