This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nitupho
Recipients nitupho
Date 2011-10-13.21:16:04
SpamBayes Score 3.8525133e-10
Marked as misclassified No
Message-id <1318540565.49.0.753035083637.issue13173@psf.upfronthosting.co.za>
In-reply-to
Content
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.'
History
Date User Action Args
2011-10-13 21:16:05nituphosetrecipients: + nitupho
2011-10-13 21:16:05nituphosetmessageid: <1318540565.49.0.753035083637.issue13173@psf.upfronthosting.co.za>
2011-10-13 21:16:04nitupholinkissue13173 messages
2011-10-13 21:16:04nituphocreate