"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > See the following. > -- Paul > > class X(object): > ....pass > > def makeAddr(tAdd): > ....def add(self, tNum): > ........return tNum + tAdd > ....return add > > # add methods to class X > X.add1 = makeAddr(1) > X.add100 = makeAddr(100)
You or others might find this rearrangement stylistically preferable: define makeAddr first, then class X(object): add1 = makeAddr(1) add100 = makeAddr(100) ... Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list