diff options
author | Georg Brandl <georg@python.org> | 2009-09-16 15:58:14 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-16 15:58:14 (GMT) |
commit | 7f01a13e7c47b6c4bcca601b597378408f3ceb2e (patch) | |
tree | 938cccc27452ea421eb5b80521ddd8849661616b /Doc/library/string.rst | |
parent | fe99105835b59e66ca1fd53ea3f8bcec3ec7cb3c (diff) | |
download | cpython-7f01a13e7c47b6c4bcca601b597378408f3ceb2e.zip cpython-7f01a13e7c47b6c4bcca601b597378408f3ceb2e.tar.gz cpython-7f01a13e7c47b6c4bcca601b597378408f3ceb2e.tar.bz2 |
Last round of adapting style of documenting argument default values.
Diffstat (limited to 'Doc/library/string.rst')
-rw-r--r-- | Doc/library/string.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 8098651..3466af6 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -479,19 +479,19 @@ these rules. The methods of :class:`Template` are: The constructor takes a single argument which is the template string. - .. method:: substitute(mapping[, **kws]) + .. method:: substitute(mapping, **kwds) Performs the template substitution, returning a new string. *mapping* is any dictionary-like object with keys that match the placeholders in the template. Alternatively, you can provide keyword arguments, where the - keywords are the placeholders. When both *mapping* and *kws* are given - and there are duplicates, the placeholders from *kws* take precedence. + keywords are the placeholders. When both *mapping* and *kwds* are given + and there are duplicates, the placeholders from *kwds* take precedence. - .. method:: safe_substitute(mapping[, **kws]) + .. method:: safe_substitute(mapping, **kwds) Like :meth:`substitute`, except that if placeholders are missing from - *mapping* and *kws*, instead of raising a :exc:`KeyError` exception, the + *mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the original placeholder will appear in the resulting string intact. Also, unlike with :meth:`substitute`, any other appearances of the ``$`` will simply return ``$`` instead of raising :exc:`ValueError`. |