#!/usr/local/bin/python2 class C: def f(self): pass c = C() c.f.__func__.__name__ = 'a' print c.a.__name__, c