Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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