commit | 740593416a9226e217561e36d799d8698e2483f2 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Mon Feb 20 23:11:19 2012 -0500 |
committer | Benjamin Peterson <benjamin@python.org> | Mon Feb 20 23:11:19 2012 -0500 |
tree | 7f2e8150106a494b0424dff00ac8406229d6f0ee | |
parent | f093724845db20c902ff0272115f949b7d05bb40 [diff] [blame] |
use set
diff --git a/Lib/re.py b/Lib/re.py index 6a01743..cc3813f 100644 --- a/Lib/re.py +++ b/Lib/re.py
@@ -198,10 +198,7 @@ "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."