#!/usr/bin/env python class Point(object): def __init__(self, x, y): self.x = x self.y = y def __getitem__(self, i): return [self.x, self.y][i] def somePointGiveToMe(x, y): return list(Point(x, y)) if __name__ == '__main__': x, y = somePointGiveToMe(1, 2) print x, y