I already saw multiple threads about postponed usage of f-strings, but they are all relatively old.
So here are some examples I found:
# lambda-function as constant
POSTPONED_F_STRING = lambda x, y, z: f"Use variables: {x}, {y}, {z}"
# function/method
def fstr(template):
return eval(f"f'{template}'")
Or is it even better to use the old str.format() in this case? Any new stuff I didn't mention?
I would really like to here some input on the "right" way to do this, if there even is one.
Thanks in advance!