|
|
1
5
只需创建从元组继承并重写的新类
|
|
2
1
|
|
|
3
0
使用namedtuple( https://docs.python.org/3/library/collections.html#collections.namedtuple
|
|
|
4
0
是的,您可以通过一个“映射”来实现这一点——用其他类的属性创建一个自定义类。 资源: http://www.kr41.net/2016/03-23-dont_inherit_python_builtin_dict_type.html
您最好使用更复杂的数据结构,例如元组字典。
或(注释结构)
|