summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libtextwrap.tex
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2006-06-11 00:40:49 (GMT)
committerGreg Ward <gward@python.net>2006-06-11 00:40:49 (GMT)
commit7f54740c4ddacf99eba5bb18abe904a6a4960165 (patch)
tree3bb108337bc5a5ac0b51f3cb4c5b59391b0d88e1 /Doc/lib/libtextwrap.tex
parent0e1159583c06fdf85d7d2dbe8b82e42565b9d166 (diff)
downloadcpython-7f54740c4ddacf99eba5bb18abe904a6a4960165.zip
cpython-7f54740c4ddacf99eba5bb18abe904a6a4960165.tar.gz
cpython-7f54740c4ddacf99eba5bb18abe904a6a4960165.tar.bz2
Bug #1361643: fix textwrap.dedent() so it handles tabs appropriately,
i.e. do *not* expand tabs, but treat them as whitespace that is not equivalent to spaces. Add a couple of test cases. Clarify docs.
Diffstat (limited to 'Doc/lib/libtextwrap.tex')
-rw-r--r--Doc/lib/libtextwrap.tex15
1 files changed, 10 insertions, 5 deletions
diff --git a/Doc/lib/libtextwrap.tex b/Doc/lib/libtextwrap.tex
index 9fb0816..38f9b03 100644
--- a/Doc/lib/libtextwrap.tex
+++ b/Doc/lib/libtextwrap.tex
@@ -47,12 +47,17 @@ remove indentation from strings that have unwanted whitespace to the
left of the text.
\begin{funcdesc}{dedent}{text}
-Remove any whitespace that can be uniformly removed from the left
-of every line in \var{text}.
+Remove any common leading whitespace from every line in \var{text}.
-This is typically used to make triple-quoted strings line up with
-the left edge of screen/whatever, while still presenting it in the
-source code in indented form.
+This can be used to make triple-quoted strings line up with the left
+edge of the display, while still presenting them in the source code
+in indented form.
+
+Note that tabs and spaces are both treated as whitespace, but they are
+not equal: the lines \code{" {} hello"} and \code{"\textbackslash{}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.)
For example:
\begin{verbatim}