From: Benjamin Peterson Date: Tue, 21 Feb 2012 04:11:19 +0000 (-0500) Subject: use set X-Git-Tag: v2.7.3rc1~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=740593416a9226e217561e36d799d8698e2483f2;p=thirdparty%2FPython%2Fcpython.git use set --- diff --git a/Lib/re.py b/Lib/re.py index 6a0174308969..cc3813f80a02 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."