On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > There must be a way to inherit from the list type without having to > redefine all the methods and attributes that regular lists have.
Like this: class Point(list): def __init__(self, x, y, z = 1): list.__init__(self, [x, y, z]) def __getattr__(self, name): if name == 'x': return self[0] if name == 'y': return self[1] if name == 'z': return self[2] def __setattr__(self, name, value): if name == 'x': self[0] = value if name == 'y': self[1] = value if name == 'z': self[2] = value Does that show you what you need? -- Jerry -- http://mail.python.org/mailman/listinfo/python-list