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

SourceForge.net noreply at sourceforge.net
Mon Sep 13 16:33:30 CEST 2004


Patches item #1026859, was opened at 2004-09-12 16:19
Message generated for change (Comment added) made by bwarsaw
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: Closed
>Resolution: Accepted
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'


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

>Comment By: Barry A. Warsaw (bwarsaw)
Date: 2004-09-13 10:33

Message:
Logged In: YES 
user_id=12800

accepted, with slight modifications

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

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