cpython: 98732d20b6d1 (original) (raw)
Mercurial > cpython
changeset 75112:98732d20b6d1 2.7
use set
Benjamin Peterson benjamin@python.org | |
---|---|
date | Mon, 20 Feb 2012 23:11:19 -0500 |
parents | 47232e4b73bc |
children | 475d5a749756 |
files | Lib/re.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-)[+] [-] Lib/re.py 5 |
line wrap: on
line diff
--- a/Lib/re.py +++ b/Lib/re.py @@ -198,10 +198,7 @@ def template(pattern, flags=0): "Compile a template pattern, returning a pattern object" return _compile(pattern, flags|T) -_alphanum = {} -for c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890':
-del c +_alphanum = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890') def escape(pattern): "Escape all non-alphanumeric characters in pattern."