Skip to content

Instantly share code, notes, and snippets.

View illbebach's full-sized avatar
🌶️

illbebach

🌶️
View GitHub Profile
@illbebach
illbebach / function_call_indirect.py
Created December 9, 2020 00:13
call python functions indirectly
''' 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
@illbebach
illbebach / print_function_name.py
Last active December 9, 2020 00:14
get your python function name
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):