Python中的命名元组:它们是什么类型?
原文英文,约400词,阅读约需2分钟。发表于: 。Named tuples in Python are an extension of the built-in tuple data type, allowing you to give meaningful names to the elements of a tuple. In others words, named tuples are tuples with named...
命名元组是Python中元组的扩展,允许为元素赋予名称。它们是不可变的类,通过namedtuple创建,生成的类继承自元组,实例既是Point类型的对象,也是元组。