]> granicus.if.org Git - python/commitdiff
a frozenset is better here
authorBenjamin Peterson <benjamin@python.org>
Tue, 21 Feb 2012 04:13:20 +0000 (23:13 -0500)
committerBenjamin Peterson <benjamin@python.org>
Tue, 21 Feb 2012 04:13:20 +0000 (23:13 -0500)
Lib/re.py

index cc3813f80a0249dd73fd1e8f5d8a1ddf8e3d9c9e..3934f499c8688574b66fe6dbd4f44fb3cf2810e5 100644 (file)
--- 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."