diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-03-25 12:19:30 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-03-25 12:19:30 (GMT) |
commit | ebbf1e67a8c56a79ee62280d32517e77b103bf8e (patch) | |
tree | 4893e0a1bed71573f4cd0b3712540fa6142a9747 /Lib | |
parent | 7b9e97b48765780ec71db330022bc68ba73a4b19 (diff) | |
download | cpython-ebbf1e67a8c56a79ee62280d32517e77b103bf8e.zip cpython-ebbf1e67a8c56a79ee62280d32517e77b103bf8e.tar.gz cpython-ebbf1e67a8c56a79ee62280d32517e77b103bf8e.tar.bz2 |
#2650: Refactor re.escape to use enumerate().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/re.py | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -223,8 +223,7 @@ def escape(pattern): 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" |