http://hg.python.org/cpython/rev/ed02db9921ac changeset: 68924:ed02db9921ac branch: 3.1 user: Ezio Melotti <ezio.melotti at gmail.com> date: Fri Mar 25 14:19:30 2011 +0200 summary: #2650: Refactor re.escape to use enumerate(). files: Lib/re.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/Lib/re.py b/Lib/re.py --- a/Lib/re.py +++ b/Lib/re.py @@ -223,8 +223,7 @@ if isinstance(pattern, str): alphanum = _alphanum_str s = list(pattern) - for i in range(len(pattern)): - c = pattern[i] + for i, c in enumerate(pattern): if c not in alphanum: if c == "000円": s[i] = "\000円" -- Repository URL: http://hg.python.org/cpython