[Python-ideas] Draft PEP on string interpolation

Mike Miller python-ideas at mgmiller.net
Fri Aug 21 04:46:54 CEST 2015


I'm guessing there's not much else we can do here but use another string prefix. 
  To stay consistent, I'd expect a slight modification to:

     Nt'Hello {name}.'

However, if we were determined to reduce the number of prefixes, an alternative 
might be to put a flag inside the string.  My first thought is of django/jinja 
templating comments:

     t'{# deferred=1 #}Hello {name}.'

How does that sound?

-Mike


On 08/20/2015 05:39 PM, Guido van Rossum wrote:
 > Second, do you have a proposal for marking translatable strings that shouldbe
 > extracted by pygettext but not interpolated in the spot where they occur?
 > (This the N_(...) format from the pygettext docs.)



More information about the Python-ideas mailing list