Bob Gailer wrote: > class PointND(list): > def __init__(self, *a_list): > super(PointND, self).__init__(a_list) > > def getSet(ix): > def chklen(self): > if len(self) < ix + 1: > raise AttributeError > def get(self): > chklen(self) > return self[ix] > def set(self, value): > chklen(self) > self[ix] = value > return property(get, set) > > def set(self, ix): > return s > > x = getSet(0) > y = getSet(1) > z = getSet(2) > [snip]
Bob and Hugo, thanks for enlightening me to class properties. Obviously, I'm still on the learning curve. Bob, I'm not seeing where the outer "def set(self, ix)" is used. Am I missing something? thanks, matt _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
