by kazagistar · 9y ago · 0 comments
The better design binds the values to the string, but does not interpolate into a string type fully. Then, the resulting object can be passed to a consumer like an SQL engine (and appropriately escaped) or an internationalization library (and swapped out for a translated string before interpolation).
I mean, I appreciate what they did, but it seems like missing a massive opportunity to provide a linguistic building block for library authors.
[1] https://docs.python.org/2/library/gettext.html#gnu-gettext-a...
_('your template here {foo}').format(foo=foo)
which is a step down from f'your template here {foo}'