Commit bc60c471 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

[2.7] bpo-30754: Document textwrap.dedent blank line behavior. (GH-14469) (GH-14475)



* Added documentation for textwrap.dedent behavior.
(cherry picked from commit eb97b921)
Co-authored-by: default avatartmblweed <tmblweed@users.noreply.github.com>


https://bugs.python.org/issue30754
parent 065aff3c
......@@ -66,6 +66,9 @@ indentation from strings that have unwanted whitespace to the left of the text.
of this module incorrectly expanded tabs before searching for 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():
......
......@@ -383,6 +383,8 @@ def dedent(text):
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.)
Entirely blank lines are normalized to a newline character.
"""
# Look for the longest leading string of spaces and tabs common to
# all lines.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment