"Refactor" doesn't sound like it belongs in the 3.1 branch... Georg
On 25.03.2011 13:27, ezio.melotti wrote: > http://hg.python.org/cpython/rev/ed02db9921ac > changeset: 68924:ed02db9921ac > branch: 3.1 > user: Ezio Melotti <ezio.melo...@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" > > > > > _______________________________________________ > Python-checkins mailing list > python-check...@python.org > http://mail.python.org/mailman/listinfo/python-checkins _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com