class A(object):
    pass

def make_method(name):

    def _method(self):
        print('method {0} in {1}'.format(name, self))
return _method
for name in ('one', 'two', 'three'):
    _method = make_method(name)
setattr(A, name, _method)
Python dynamic function creation with custom names