Home
last modified time | relevance | path

Searched refs:safe_substitute (Results 1 – 6 of 6) sorted by relevance

/third_party/python/Lib/test/
Dtest_string.py245 eq(s.safe_substitute(d), '%(foo)s baz baz')
252 eq(s.safe_substitute(d), 'tim has eaten 7 bags of ham today')
261 eq(s.safe_substitute(d), "('tim', 'fred') ate ('ham', 'kung pao')")
266 eq(s.safe_substitute(dict(who='tim')), 'tim likes ${what} for ${meal}')
267 eq(s.safe_substitute(dict(what='ham')), '$who likes ham for ${meal}')
268 eq(s.safe_substitute(dict(what='ham', meal='dinner')),
270 eq(s.safe_substitute(dict(who='tim', what='ham')),
272 eq(s.safe_substitute(dict(who='tim', what='ham', meal='dinner')),
307 self.assertEqual(s.safe_substitute(d), 'fredHO likes ${WHAT} for dinner')
359 self.assertRaises(ValueError, s.safe_substitute, {})
[all …]
/third_party/python/Lib/
Dstring.py123 def safe_substitute(self, mapping=_sentinel_dict, /, **kws): member in Template
/third_party/python/Doc/tutorial/
Dstdlib2.rst91 :meth:`~string.Template.safe_substitute` method may be more appropriate ---
100 >>> t.safe_substitute(d)
/third_party/python/Doc/library/
Dstring.rst771 .. method:: safe_substitute(mapping={}, /, **kwds)
781 raising an exception. In another sense, :meth:`safe_substitute` may be
808 >>> Template('$who likes $what').safe_substitute(d)
/third_party/python/Doc/whatsnew/
D2.4.rst201 raise a :exc:`KeyError`. There's also a :meth:`safe_substitute` method that
205 >>> t.safe_substitute({'page':3})
/third_party/python/Misc/
DHISTORY19648 - Patch #1056967 changes the semantics of Template.safe_substitute() so that