Optimize optimization and fix method name in docstring.

This commit is contained in:
Georg Brandl 2009-09-18 16:19:56 +00:00
parent b019951875
commit 195261f823
1 changed files with 3 additions and 3 deletions

View File

@ -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: