From 195261f82326e2d99c07e839514fec60a9d31503 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 18 Sep 2009 16:19:56 +0000 Subject: [PATCH] Optimize optimization and fix method name in docstring. --- Lib/textwrap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/textwrap.py b/Lib/textwrap.py index 64a5b97c92a..9582a1c02f5 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: