summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2009-09-26 12:35:01 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2009-09-26 12:35:01 (GMT)
commit029625c3f6bf3a205a04f067facaae21174ef48a (patch)
treeab486b1307906c48271d8860fad6839b2b58e139 /Doc/library
parent2dcd4c5a0f5fba4a1e34e4a902971c2e4ce7349f (diff)
downloadcpython-029625c3f6bf3a205a04f067facaae21174ef48a.zip
cpython-029625c3f6bf3a205a04f067facaae21174ef48a.tar.gz
cpython-029625c3f6bf3a205a04f067facaae21174ef48a.tar.bz2
Merged revisions 75074 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75074 | ezio.melotti | 2009-09-26 15:33:22 +0300 (Sat, 26 Sep 2009) | 9 lines Merged revisions 75070 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75070 | ezio.melotti | 2009-09-26 14:20:53 +0300 (Sat, 26 Sep 2009) | 1 line #7000: document "sep" in capwords. Add a few tests ........ ................
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/string.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 2fd70be9..ae068a9 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -565,12 +565,14 @@ rule:
Helper functions
----------------
-.. function:: capwords(s)
-
- Split the argument into words using :func:`split`, capitalize each word using
- :func:`capitalize`, and join the capitalized words using :func:`join`. Note
- that this replaces runs of whitespace characters by a single space, and removes
- leading and trailing whitespace.
+.. function:: capwords(s[, sep])
+
+ Split the argument into words using :meth:`str.split`, capitalize each word
+ using :meth:`str.capitalize`, and join the capitalized words using
+ :meth:`str.join`. If the optional second argument *sep* is absent
+ or ``None``, runs of whitespace characters are replaced by a single space
+ and leading and trailing whitespace are removed, otherwise *sep* is used to
+ split and join the words.
.. function:: maketrans(frm, to)