diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-03-25 12:50:52 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-03-25 12:50:52 (GMT) |
commit | 4664563f3401c3d8644ea66c8e4fe71deddcbb80 (patch) | |
tree | 57d7fc9ebcd0573bd4cddfc5f22823ca22ad4b94 /Lib/re.py | |
parent | 72de205895d01ae6f461ae795af95094daf06fac (diff) | |
download | cpython-4664563f3401c3d8644ea66c8e4fe71deddcbb80.zip cpython-4664563f3401c3d8644ea66c8e4fe71deddcbb80.tar.gz cpython-4664563f3401c3d8644ea66c8e4fe71deddcbb80.tar.bz2 |
#2650: Refactor re.escape and its tests.
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -207,8 +207,7 @@ def escape(pattern): "Escape all non-alphanumeric characters in pattern." s = list(pattern) alphanum = _alphanum - 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" |