[Python-ideas] Draft PEP on string interpolation
Mike Miller
python-ideas at mgmiller.net
Sat Aug 22 01:21:54 CEST 2015
The more I think about it, trying to push str.format() (or similar) syntax into
i18n is just too much. We'll need a different prefix anyway because of the
compile/runtime differences so why not stick with str.Template formatting?
It fits the use case perfectly, and requires little additional work.
Trying to get consistency with str.format() syntax creates security, policy,
docs, and tools requirements. Instead, we could accept a small inconsistency
(in the grand scheme of things) in order to use the right tool for the job::
# powerful formatting
f'Folder {folder}'
# simple translation
t'Hello $name.' # or i'', _'', etc
dt'Hello # deferred translation
I'd like to update my draft to reflect this change, unless anyone has objections.
-Mike
More information about the Python-ideas
mailing list