summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-02-21 04:13:20 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-02-21 04:13:20 (GMT)
commitc59df7d4e916d12bd110701943277f77c1ebd4de (patch)
tree5288bc36a2d376ad7909a9673931fbee0ad4bfdd /Lib
parent740593416a9226e217561e36d799d8698e2483f2 (diff)
downloadcpython-c59df7d4e916d12bd110701943277f77c1ebd4de.zip
cpython-c59df7d4e916d12bd110701943277f77c1ebd4de.tar.gz
cpython-c59df7d4e916d12bd110701943277f77c1ebd4de.tar.bz2
a frozenset is better here
Diffstat (limited to 'Lib')
-rw-r--r--Lib/re.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/re.py b/Lib/re.py
index cc3813f..3934f49 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."