Barry A. Warsaw added the comment:
So yeah, we don't want to deprecate string.Template. It has a very specific
use case that's used a lot, i.e. making strings dead simple to translate.
%(foo)s was very problematic. {foo} is a little better, but looks too weird
for most translators. $foo is very common, well understood, and hard to get
wrong.
As for modernizing the code (the L146 bit was thanks to Python 2), I wouldn't
be against it if it doesn't change the documented API or functionality and all
the tests still pass (and there's good coverage - I don't remember anymore). I
don't think it's really that important though; typically these are not used in
performance critical sections.
Re: ${thing.attribute} - no, that wouldn't keep them Simple and PEP 292 was
deliberately targeting simplicity.
Bottom line: keep $-strings simple and focused on their original use case. For
more complicated use cases, use str.format().
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue24309>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com