Kaydet (Commit) c811328e authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Escaped backslashes in docstrings.

üst 023de869
...@@ -1057,7 +1057,7 @@ def make_encoding_map(decoding_map): ...@@ -1057,7 +1057,7 @@ def make_encoding_map(decoding_map):
during translation. during translation.
One example where this happens is cp875.py which decodes One example where this happens is cp875.py which decodes
multiple character to \u001a. multiple character to \\u001a.
""" """
m = {} m = {}
......
...@@ -191,7 +191,7 @@ def search_reverse(prog, chars, col): ...@@ -191,7 +191,7 @@ def search_reverse(prog, chars, col):
This is done by searching forwards until there is no match. This is done by searching forwards until there is no match.
Prog: compiled re object with a search method returning a 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(). Col: stop index for the search; the limit for match.end().
''' '''
m = prog.search(chars) m = prog.search(chars)
......
...@@ -147,7 +147,7 @@ class TextWrapper: ...@@ -147,7 +147,7 @@ class TextWrapper:
"""_munge_whitespace(text : string) -> string """_munge_whitespace(text : string) -> string
Munge whitespace in text: expand tabs and convert all other 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". becomes " foo bar baz".
""" """
if self.expand_tabs: if self.expand_tabs:
...@@ -193,7 +193,7 @@ class TextWrapper: ...@@ -193,7 +193,7 @@ class TextWrapper:
"""_fix_sentence_endings(chunks : [string]) """_fix_sentence_endings(chunks : [string])
Correct for sentence endings buried in 'chunks'. Eg. when the 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", ...] and split() will convert that to [..., "foo.", " ", "Bar", ...]
which has one too few spaces; this method simply changes the one which has one too few spaces; this method simply changes the one
space to two. space to two.
...@@ -379,7 +379,7 @@ def dedent(text): ...@@ -379,7 +379,7 @@ def dedent(text):
in indented form. in indented form.
Note that tabs and spaces are both treated as whitespace, but they 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 considered to have no common leading whitespace. (This behaviour is
new in Python 2.5; older versions of this module incorrectly new in Python 2.5; older versions of this module incorrectly
expanded tabs before searching for common leading whitespace.) expanded tabs before searching for common leading whitespace.)
......
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