This commit is contained in:
Benjamin Peterson 2012-02-20 23:11:19 -05:00
parent f093724845
commit 740593416a

View file

@ -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."