From 740593416a9226e217561e36d799d8698e2483f2 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 20 Feb 2012 23:11:19 -0500 Subject: use set --- Lib/re.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Lib/re.py b/Lib/re.py index 6a01743..cc3813f 100644 --- 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': - _alphanum[c] = 1 -del c +_alphanum = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890') def escape(pattern): "Escape all non-alphanumeric characters in pattern." -- cgit v0.12