[Python-ideas] Draft PEP on string interpolation

Guido van Rossum guido at python.org
Mon Aug 24 19:38:33 CEST 2015


On Mon, Aug 24, 2015 at 10:12 AM, Barry Warsaw <barry at python.org> wrote:

> On Aug 21, 2015, at 10:52 PM, Mike Miller wrote:
>
> >Which syntax would you rather have for translation?  (Knowing that you
> might
> >give a different answer for standard interpolation.)
>
> For i18n, $-strings (aka PEP 292, string.Template) is by far the best
> choice.
> Translators are very familiar with the syntax, having used it now for many
> years (and not just in a Python context), and it's very difficult for
> non-technical folks to get wrong.
>
> I don't see any advantages to springing yet another i18n interpolation
> syntax
> on translators, and I definitely don't see the advantage of introducing a
> *second* i18n syntax to translators of Python programs.
>
> If that means PEP 498/501 isn't appropriate for Python i18n, so be it.
> What
> we have now works, even if its implementation requires the use of some
> frowned-upon APIs, and the use of function syntax for marking and
> invocation.
>

That's fair, and I'm glad we have this clear position on the table.

I cannot accept $ interpolation in the language definition. I also don't
want PEP 498 and 501 to use different interpolation syntaxes. So to me,
this means that i18n is off the table as a motivation for PEP 501 (it never
was on the table for 498), and Nick can focus on motivational examples from
html/sql/shell code injection for PEP 501 (but only if he can live with the
PEP 498 surface syntax for interpolation).

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150824/caffe012/attachment.html>


More information about the Python-ideas mailing list