Kaydet (Commit) 74059341 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

use set

üst f0937248
...@@ -198,10 +198,7 @@ def template(pattern, flags=0): ...@@ -198,10 +198,7 @@ def template(pattern, flags=0):
"Compile a template pattern, returning a pattern object" "Compile a template pattern, returning a pattern object"
return _compile(pattern, flags|T) return _compile(pattern, flags|T)
_alphanum = {} _alphanum = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890')
for c in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890':
_alphanum[c] = 1
del c
def escape(pattern): def escape(pattern):
"Escape all non-alphanumeric characters in pattern." "Escape all non-alphanumeric characters in pattern."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment