With .format we can unpack a dictionary into a string template. That's the only thing I haven't found how to do with f-strings.
Is there a way to do it?
E.g. how to do this with f-strings?
template = "my values: {number} {item}"
values = dict(number=1, item='box')
print(template.format(**values))
Edit:
I thought you can have f-string templates for undefined values with something like this, but it doesn't work either:
template2 = "my values: {(number := None)} {(item := None)}" # values are immutable after defining
values = dict(number=1, item='box')
# how to unpack `values` into `template2`, is it possible?
I'm aware of the longer ways to do it, what I'm looking for is only whether it's possible to use unpacking. Cheers!!