This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' demonstrate calling functions using function references in an array ''' | |
import inspect | |
def get_func_name() -> str: | |
''' return a string of the caller's function name ''' | |
return inspect.currentframe().f_back.f_code.co_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def get_func_name() -> str: | |
''' return a string of the caller's function name ''' | |
return inspect.currentframe().f_back.f_code.co_name | |
def func1(arg1, arg2): |