0

Is there a way to find a functions name from within the function?

def some_function():
    function_name = ... # some way of retrieving the name 'some_function'
    print(function_name)

The expected value of function_name would be the string: 'some_function'

nucsit026
  • 622
  • 5
  • 15
Arco Bast
  • 3,132
  • 2
  • 24
  • 50

1 Answers1

0

some_function.__name__ should work

Sam Reynolds
  • 89
  • 1
  • 10