summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/textwrap.rst3
-rw-r--r--Lib/textwrap.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/textwrap.rst b/Doc/library/textwrap.rst
index d254466..0f11ef4 100644
--- a/Doc/library/textwrap.rst
+++ b/Doc/library/textwrap.rst
@@ -77,6 +77,9 @@ functions should be good enough; otherwise, you should use an instance of
equal: the lines ``" hello"`` and ``"\thello"`` are considered to have no
common leading whitespace.
+ Lines containing only whitespace are ignored in the input and normalized to a
+ single newline character in the output.
+
For example::
def test():
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 8103f34..30e693c 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -420,9 +420,9 @@ def dedent(text):
Note that tabs and spaces are both treated as whitespace, but they
are not equal: the lines " hello" and "\\thello" are
- considered to have no common leading whitespace. (This behaviour is
- new in Python 2.5; older versions of this module incorrectly
- expanded tabs before searching for common leading whitespace.)
+ considered to have no common leading whitespace.
+
+ Entirely blank lines are normalized to a newline character.
"""
# Look for the longest leading string of spaces and tabs common to
# all lines.