毎回忘れるので、メモ。
sys._getframe().f_code.co_name
簡単な関数を書いて試してみる。
>>> def printFuncName():
... print sys._getframe().f_code.co_name
...
>>> printFuncName()
printFuncName
自分はこういう場面でよく使います。
from abc import abstractmethod
class SuperClass(object):
@abstractmethod
def implementMe():
raise NotImplementedError( sys._getframe().f_code.co_name )