diff options
author | Georg Brandl <georg@python.org> | 2009-09-18 16:19:56 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-18 16:19:56 (GMT) |
commit | 195261f82326e2d99c07e839514fec60a9d31503 (patch) | |
tree | f1180a83b13e2e4ebfe59cc6b8c28405c7105be3 /Lib/textwrap.py | |
parent | b0199518750feb2a37fe6ebfb9679329d3eb305f (diff) | |
download | cpython-195261f82326e2d99c07e839514fec60a9d31503.zip cpython-195261f82326e2d99c07e839514fec60a9d31503.tar.gz cpython-195261f82326e2d99c07e839514fec60a9d31503.tar.bz2 |
Optimize optimization and fix method name in docstring.
Diffstat (limited to 'Lib/textwrap.py')
-rw-r--r-- | Lib/textwrap.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 64a5b97..9582a1c 100644 --- a/Lib/textwrap.py +++ b/Lib/textwrap.py @@ -156,7 +156,7 @@ class TextWrapper: """_split(text : string) -> [string] Split the text to wrap into indivisible chunks. Chunks are - not quite the same as words; see wrap_chunks() for full + not quite the same as words; see _wrap_chunks() for full details. As an example, the text Look, goof-ball -- use the -b option! breaks into the following chunks: @@ -191,9 +191,9 @@ class TextWrapper: space to two. """ i = 0 - pat = self.sentence_end_re + patsearch = self.sentence_end_re.search while i < len(chunks)-1: - if chunks[i+1] == " " and pat.search(chunks[i]): + if chunks[i+1] == " " and patsearch(chunks[i]): chunks[i+1] = " " i += 2 else: |