def __init__(self, x, y, z):
    self.coords = x, y, z

@property
def x(self):
    return self.coords[0]

def __getitem__(self, item):
    return self.coords[item]
How to make a list object? instance has no attribute '__getitem__'