Obtenez le nom de fonction actuel dans Python3

import inspect
def myfirstfunc():
    print(inspect.currentframe().f_code.co_name)
    # OR
    print(inspect.stack()[0][3])
myfirstfunc()
Majid Peidaei