[Patches] [ python-Patches-1026859 ] Add keyword arguments to Template substitutions

SourceForge.net noreply at sourceforge.net
Sun Sep 12 22:19:17 CEST 2004


Patches item #1026859, was opened at 2004-09-12 15:19
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1026859&group_id=5470

Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: Add keyword arguments to Template substitutions

Initial Comment:
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'


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1026859&group_id=5470


More information about the Patches mailing list