Is it possible to use f-string
to modify output of Python's default argument?
I want such functionallity to re-name one argument per function's calling.
When calling a function with xyz
argument I would like to see it injected into v
in f"this_is_{v}
.
Below pseudo code to give high-level idea of what I'm aiming at.
def function(parameter=f"this_is_{v}"):
print(parameter)
function("first")
#prints this_is_first
function("second")
#prints this_is_second
Was thinking about alternative mechanism for below code:
def function(v):
value=f"this_is_{v}"
print(value)
function("first")
function("second")