I would like to convert the following to Hy, but I can't seem to figure out how to do it; is there perhaps a way to convert a string of python code to the hy syntax? I don't know if py
would work because the evaluated result of f_back
may not be safe.
import ast, inspect
def test(f_back):
return ast.literal_eval(f"inspect.currentframe(){'.f_back' * f_back}")