namedtuple 能够实现类似类的效果,tuple 的元素可以通过属性的形式返回,如下所示: from collections import namedtuple Student = namedtuple('stu', ['Name', 'Age', 'Height', 'Weight']) Alex = Student('Alex', 23, '173', '63') Vincent = Student('Vincent', 20, '172', '57') Alex.Name Alex.