Bfontaine added the comment:
When you are using a lot of string templates like I am doing, I think it's
better if the defaults is attached directly to the template instance.
This:
[, , , , ...]
is easier to use than:
[(, ),
Bfontaine added the comment:
A "light" version of diff added (rewrapped content is replaced by
"[rewrapping]")
--
Added file:
http://bugs.python.org/file23455/string_template_default_values2-light.patch
___
Python tracker
<
Bfontaine added the comment:
diff updated
--
Added file:
http://bugs.python.org/file23454/string_template_default_values2.patch
___
Python tracker
<http://bugs.python.org/issue13
Bfontaine added the comment:
Here is my code as a diff
--
keywords: +patch
Added file:
http://bugs.python.org/file23408/string_template_default_values.patch
___
Python tracker
<http://bugs.python.org/issue13
New submission from Bfontaine :
This patch allows you to define default values for a string.Template, which is
useful when you need to use a lot some values, but sometimes other values.
for example:
>>> from string import Template
>>> s = Template("${user} made me a ${