New submission from Bfontaine <bati...@yahoo.fr>: 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 ${flavor} cake.", default={"user":"Dennis"}) >>> s.substitute(flavor="vanilla") 'Dennis made me a vanilla cake.' >>> s.substitute(user="Ken", flavor="chocolate") 'Ken made me chocolate cake.' ---------- components: Library (Lib) files: string_template_default_values.tar messages: 145485 nosy: nitupho priority: normal severity: normal status: open title: Default values for string.Template type: feature request versions: Python 3.2 Added file: http://bugs.python.org/file23398/string_template_default_values.tar _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13173> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com