summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-28 17:29:25 (GMT)
committerGitHub <noreply@github.com>2021-07-28 17:29:25 (GMT)
commit97af790495f580a60253f9d8c50b26eeb53d9926 (patch)
tree1add7cb22b4edee51e4ebb52db8c6d89a8542923 /Doc/library
parent8789add99164177f29a8cd319a834187c65ab16c (diff)
downloadcpython-97af790495f580a60253f9d8c50b26eeb53d9926.zip
cpython-97af790495f580a60253f9d8c50b26eeb53d9926.tar.gz
cpython-97af790495f580a60253f9d8c50b26eeb53d9926.tar.bz2
bpo-44544: [doc] list all textwrap func kwargs (GH-26999) (GH-27424)
(cherry picked from commit c1e39d6b1167376fdaf3f288ba9a689e61c7fdd1) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/textwrap.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index 1683710..b729b83 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -17,7 +17,11 @@ If you're just wrapping or filling one 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=70, **kwargs)
+.. function:: wrap(text, width=70, *, initial_indent="", \
+ subsequent_indent="", expand_tabs=True, \
+ replace_whitespace=True, fix_sentence_endings=False, \
+ break_long_words=True, drop_whitespace=True, \
+ break_on_hyphens=True, tabsize=8, max_lines=None)
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
@@ -30,7 +34,12 @@ functions should be good enough; otherwise, you should use an instance of
:func:`wrap` behaves.
-.. function:: fill(text, width=70, **kwargs)
+.. function:: fill(text, width=70, *, initial_indent="", \
+ subsequent_indent="", expand_tabs=True, \
+ replace_whitespace=True, fix_sentence_endings=False, \
+ break_long_words=True, drop_whitespace=True, \
+ break_on_hyphens=True, tabsize=8, \
+ max_lines=None)
Wraps the single paragraph in *text*, and returns a single string containing the
wrapped paragraph. :func:`fill` is shorthand for ::
@@ -41,7 +50,9 @@ functions should be good enough; otherwise, you should use an instance of
:func:`wrap`.
-.. function:: shorten(text, width, **kwargs)
+.. function:: shorten(text, width, *, fix_sentence_endings=False, \
+ break_long_words=True, break_on_hyphens=True, \
+ placeholder=' [...]')
Collapse and truncate the given *text* to fit in the given *width*.
@@ -65,7 +76,6 @@ functions should be good enough; otherwise, you should use an instance of
.. versionadded:: 3.4
-
.. function:: dedent(text)
Remove any common leading whitespace from every line in *text*.