3 ms·
I dislike them because not only are they one more string-formatting method (they're similar to but not actually identical to format-strings as you can use arbit
by masklinn 10y ago
I dislike them because not only are they one more string-formatting method (they're similar to but not actually identical to format-strings as you can use arbitrary expressions in f-string placeholders) and more importantly they're the first one which does not work at all for i18n or more generally for deferred interpolation (which is also used by `logging`)
- orf 10y ago> importantly they're the first one which does not work at all for i18n But surely i18n/deferred interpolation is a corner case, not the norm. If you need that then use what you are currently using, nothings changed.
- JelteF 10y agoNot sure, why you think they cannot be used with defered interpolation. You, can easily combine the two like this: >>> f'{"fstring"} and {{deferred}}'.format(deferred=1234) 'fstring and 1234'
- mixmastamyk 10y agoThere was a large attempt to get i18n/deferred but Guido decided to keep it simple for this release. Perhaps it can be extended in the future. In the meantime i18n uses string.Template.