[issue24309] string.Template should be using str.format and/or deprecated

2015-06-21 Thread Dmitry Kazakov
Changes by Dmitry Kazakov jsb...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24309 ___ ___ Python-bugs-list

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree with Barry. And please note, that string.Template is not invented in Python, it is used in a lot of other languages, including shell, make, Tcl, Perl. One of the advantage is that these templates are cross-language. --

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-28 Thread Barry A. Warsaw
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

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 678a76610723 by Serhiy Storchaka in branch 'default': Issue #24309: Removed Python 2 idioms. https://hg.python.org/cpython/rev/678a76610723 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-28 Thread R. David Murray
R. David Murray added the comment: Yes, I'm sure there is a lot of code that uses string.Template, partly because I've used it in at least three different projects for three different customers ;) If you are willing to write a patch that might get superseded by Serhiy's code (if he decides

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-27 Thread Dmitry Kazakov
New submission from Dmitry Kazakov: I came across this piece of code in Lib/string.py:146: # We use this idiom instead of str() because the latter will # fail if val is a Unicode containing non-ASCII characters. return '%s' % (mapping[named],) This seems vestigial. I think it'd be

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm strongly -1 for deprecating string.Template. It provides simple, widely used syntax, and is used in a lot of third-party code. I don't think that it needs to be extended. However I have an idea about implementing general string composing engine than

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I came across this piece of code in Lib/string.py:146: That may be artifact from the days of ASCII strings and may or may not have analog with the bytes data type. But I'm not exactly sure string.Template should be in Python 3 at all. It still has

[issue24309] string.Template should be using str.format and/or deprecated

2015-05-27 Thread Dmitry Kazakov
Dmitry Kazakov added the comment: Ugh, I guess I was too quick to propose deprecation, sorry :( But is it a strict No to the proposed use of str.format as well? This would be a (relatively) minor but useful change which, again, won't break anything. I can write the patch. --