mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
a frozenset is better here
This commit is contained in:
parent
740593416a
commit
c59df7d4e9
1 changed files with 2 additions and 1 deletions
|
@ -198,7 +198,8 @@ 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 = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890')
|
_alphanum = frozenset(
|
||||||
|
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890")
|
||||||
|
|
||||||
def escape(pattern):
|
def escape(pattern):
|
||||||
"Escape all non-alphanumeric characters in pattern."
|
"Escape all non-alphanumeric characters in pattern."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue