From: Benjamin Peterson Date: Tue, 21 Feb 2012 04:13:20 +0000 (-0500) Subject: a frozenset is better here X-Git-Tag: v2.7.3rc1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c59df7d4e916d12bd110701943277f77c1ebd4de;p=python a frozenset is better here --- diff --git a/Lib/re.py b/Lib/re.py index cc3813f80a..3934f499c8 100644 --- a/Lib/re.py +++ b/Lib/re.py @@ -198,7 +198,8 @@ def template(pattern, flags=0): "Compile a template pattern, returning a pattern object" return _compile(pattern, flags|T) -_alphanum = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890') +_alphanum = frozenset( + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890") def escape(pattern): "Escape all non-alphanumeric characters in pattern."