from inspect import currentframe, getframeinfo


class MyClass:

    def foo(self):
        print('My name is %s' % getframeinfo(currentframe())[2])
How to refer to a method name from with a method in Python?