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/textwrap.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/textwrap.rst')
-rw-r--r-- | Doc/library/textwrap.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst index 883d5f9..f66416f 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="* ") |