from collections import namedtuple Point = namedtuple('Point', 'x y') p = Point(1, y=2) p[0] # 1 p.x # 1 getattr(p, 'y') # 2 p._fields # Or: Point._fields # ('x', 'y')