- 2026年07月08日
- 星期三
# Python 3class Point(tuple): def __init__(self, x, y): super().__init__((x, y))Point(2, 3) 会导致 TypeError: tuple() takes at most 1 argument (2 given) 为什么?我该怎么做呢? 元组是一个不可变类型.在__init__被调用
# Python 3class Point(tuple): def __init__(self, x, y): super().__init__((x, y))Point(2, 3) 会导致 TypeError: tuple() takes at most 1 argument (2 given) 为什么?我该怎么做呢? 元组是一个不可变类型.在__init__被调用