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
  • 652
  • 7
  • 16
Arco Bast
  • 3,595
  • 2
  • 26
  • 53

1 Answers1

0

some_function.__name__ should work

Sam Reynolds
  • 89
  • 1
  • 10