I would like to rename a python function by passing its name to itself as a string.
for example.
def ihavenoname(new_name="cheese"):
something.this_function.name= new_name
# https://stackoverflow.com/questions/251464/how-to-get-a-function-name-as-a-string-in-python
import traceback
stack = traceback.extract_stack()
filename, codeline, funcName, text = stack[-2]
return funcName
>>>"cheese"==ihavenoname() # True
is this possible?