2 ms·
Those aren't the only two options. Like GP I don't like f-strings, but there was something introduced before that: the format function. "The thing is {foo},
by Izkata 2mo ago
Those aren't the only two options. Like GP I don't like f-strings, but there was something introduced before that: the format function.
"The thing is {foo}, and also {foo} again".format(foo=x+y)
It also supports positional with empty {}. And like f-strings, you can put formatting information after a colon.
%-based printf-style did also have named variables like this but it seemed less known.
- circuit10 2mo agoThis is still significantly more clunky than f-strings, especially when you're writing them a lot for debugging purposes