Re:PEP 750 – Template Strings (t-strings) have been accepted
by throwaway2037 on Friday April 11, 2025 @07:44AM
(#43652752)
> Not so bad for one argument but gets linearly worse.
This is a powerful "pro". Thanks.
Sprint is better in that regard, we can read from left to right without interruptions, but is a pain to write due to all the punctuation, nevermind refactor. For example, try adding a new variable between "This" and "house". With the f-string you just type {var} before "house" and you're done. With Sprint, you're now juggling quotation marks and commas. And that's just a simple addition of a new variable. Moving variables or substrings around is even worse.
Summing up, f-strings are substantially more ergonomic to use and since string formatting is so commonly done, this adds up quickly.