2 ms·
On the language side, most of the code is already there to implement f-strings; on the library side, it's two classes that are practically already written in th
by zahlman 2y ago
On the language side, most of the code is already there to implement f-strings; on the library side, it's two classes that are practically already written in the PEP.
The value proposition is that you can use f-string syntax but still defer evaluation like you would with a `.format` call (equivalently: you can prepare templates to format later, without having to repeat the arguments when calling `.format` and without having to re-parse the string for each call). You can also define additional ways to format the string, and thus re-format it multiple different ways. The PEP includes an example of using t-strings (if I might call them that) to do parameterized SQL queries.