commit | c59df7d4e916d12bd110701943277f77c1ebd4de | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Mon Feb 20 23:13:20 2012 -0500 |
committer | Benjamin Peterson <benjamin@python.org> | Mon Feb 20 23:13:20 2012 -0500 |
tree | 5288bc36a2d376ad7909a9673931fbee0ad4bfdd | |
parent | 740593416a9226e217561e36d799d8698e2483f2 [diff] |
a frozenset is better here
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 @@ "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."