diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-02-21 04:11:19 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-02-21 04:11:19 (GMT) |
commit | 740593416a9226e217561e36d799d8698e2483f2 (patch) | |
tree | 7f2e8150106a494b0424dff00ac8406229d6f0ee /Lib | |
parent | f093724845db20c902ff0272115f949b7d05bb40 (diff) | |
download | cpython-740593416a9226e217561e36d799d8698e2483f2.zip cpython-740593416a9226e217561e36d799d8698e2483f2.tar.gz cpython-740593416a9226e217561e36d799d8698e2483f2.tar.bz2 |
use set
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/re.py | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -198,10 +198,7 @@ def template(pattern, flags=0): "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." |