I am trying to build a format string with lazy argument, eg I need smth like:
\"%s \\%s %s\" % (\'foo\', \'bar\') # \"foo %s bar\"
how can
Python 3.6 now supports shorthand literal string interpolation with PEP 498. For your use case, the new syntax allows:
var1 = 'foo' var2 = 'bar' print(f"{var1} %s {var2}")