[Python-checkins] cpython (2.7): Escaped backslashes in docstrings.
serhiy.storchaka
python-checkins at python.org
Fri Apr 3 17:13:45 CEST 2015
https://hg.python.org/cpython/rev/fe34dfea16b0
changeset: 95416:fe34dfea16b0
branch: 2.7
parent: 95405:7f9597b44740
user: Serhiy Storchaka <storchaka at gmail.com>
date: Fri Apr 03 18:12:32 2015 +0300
summary:
Escaped backslashes in docstrings.
files:
Lib/codecs.py | 2 +-
Lib/idlelib/SearchEngine.py | 2 +-
Lib/textwrap.py | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/Lib/codecs.py b/Lib/codecs.py
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -1057,7 +1057,7 @@
during translation.
One example where this happens is cp875.py which decodes
- multiple character to \u001a.
+ multiple character to \\u001a.
"""
m = {}
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py
--- a/Lib/idlelib/SearchEngine.py
+++ b/Lib/idlelib/SearchEngine.py
@@ -191,7 +191,7 @@
This is done by searching forwards until there is no match.
Prog: compiled re object with a search method returning a match.
- Chars: line of text, without \n.
+ Chars: line of text, without \\n.
Col: stop index for the search; the limit for match.end().
'''
m = prog.search(chars)
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -147,7 +147,7 @@
"""_munge_whitespace(text : string) -> string
Munge whitespace in text: expand tabs and convert all other
- whitespace characters to spaces. Eg. " foo\tbar\n\nbaz"
+ whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
becomes " foo bar baz".
"""
if self.expand_tabs:
@@ -193,7 +193,7 @@
"""_fix_sentence_endings(chunks : [string])
Correct for sentence endings buried in 'chunks'. Eg. when the
- original text contains "... foo.\nBar ...", munge_whitespace()
+ original text contains "... foo.\\nBar ...", munge_whitespace()
and split() will convert that to [..., "foo.", " ", "Bar", ...]
which has one too few spaces; this method simply changes the one
space to two.
@@ -379,7 +379,7 @@
in indented form.
Note that tabs and spaces are both treated as whitespace, but they
- are not equal: the lines " hello" and "\thello" are
+ 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.)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list