1 import collections 2 MytupleClass = collections.namedtuple('MytupleClass',['x','y','z']) 3 obj = MytupleClass(11,22,33) 4 print(obj) 5 print(obj.x) 6 print(obj.y) 7 print(obj.z)
MytupleClass(x=11, y=22, z=33) 11 22 33