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.

classification
Title: Add keyword arguments to Template substitutions
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, rhettinger
Priority: normal Keywords: patch

Created on 2004-09-12 20:19 by rhettinger, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
string.diff rhettinger, 2004-09-12 20:19 Diff for string.py
Messages (2)
msg46890 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-09-12 20:19
Allows beautiful, clean calls with keyword arguments
when applicable:

>>> Template('time is $obj').substitute(obj='money')
'time is money'

If both a mapping and keywords are supplied, conflicts
are resolved as they are for the dict constructor:

>>> dict({'a':1}, a=2)
{'a': 2}
>>> Template('time is
$obj').safe_substitute({'obj':'t'}, obj='money')
'time is money'
msg46891 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-09-13 14:33
Logged In: YES 
user_id=12800

accepted, with slight modifications
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40902
2004-09-12 20:19:17rhettingercreate