from inspect import currentframe | |
def f(s): | |
frame = currentframe().f_back | |
return eval(f"f'{s}'", frame.f_locals, frame.f_globals) | |
#usage: | |
f(_('Hey, {username}')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment