summaryrefslogtreecommitdiff
path: root/Doc/library/textwrap.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-16 15:58:14 +0000
committerGeorg Brandl <georg@python.org>2009-09-16 15:58:14 +0000
commitca1aaadd46e823a274d3eb28b764c1f86e9ef249 (patch)
treefdb05ff51c0e1e68399396c65524b4ab810050f5 /Doc/library/textwrap.rst
parent592795241917d4f21cf68c3ed632e5d96c7dcd58 (diff)
downloadcpython-ca1aaadd46e823a274d3eb28b764c1f86e9ef249.tar.gz
Last round of adapting style of documenting argument default values.
Diffstat (limited to 'Doc/library/textwrap.rst')
-rw-r--r--Doc/library/textwrap.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index 883d5f9b04..f66416f3c6 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -1,4 +1,3 @@
-
:mod:`textwrap` --- Text wrapping and filling
=============================================
@@ -15,16 +14,17 @@ or two text strings, the convenience functions should be good enough;
otherwise, you should use an instance of :class:`TextWrapper` for efficiency.
-.. function:: wrap(text[, width[, ...]])
+.. function:: wrap(text, width=70, **kwargs)
- Wraps the single paragraph in *text* (a string) so every line is at most *width*
- characters long. Returns a list of output lines, without final newlines.
+ Wraps the single paragraph in *text* (a string) so every line is at most
+ *width* characters long. Returns a list of output lines, without final
+ newlines.
Optional keyword arguments correspond to the instance attributes of
:class:`TextWrapper`, documented below. *width* defaults to ``70``.
-.. function:: fill(text[, width[, ...]])
+.. function:: fill(text, width=70, **kwargs)
Wraps the single paragraph in *text*, and returns a single string containing the
wrapped paragraph. :func:`fill` is shorthand for ::
@@ -70,11 +70,11 @@ indentation from strings that have unwanted whitespace to the left of the text.
print(repr(dedent(s))) # prints 'hello\n world\n'
-.. class:: TextWrapper(...)
+.. class:: TextWrapper(**kwargs)
The :class:`TextWrapper` constructor accepts a number of optional keyword
- arguments. Each argument corresponds to one instance attribute, so for example
- ::
+ arguments. Each keyword argument corresponds to an instance attribute, so
+ for example ::
wrapper = TextWrapper(initial_indent="* ")