summaryrefslogtreecommitdiff
path: root/Lib/re.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-02-17 01:33:37 -0800
committerRaymond Hettinger <python@rcn.com>2013-02-17 01:33:37 -0800
commitd0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc (patch)
tree7912db2e919fa3433d44ba5b500bb661d1701207 /Lib/re.py
parent5b49962f7e38a3c02db583a306fb717ae2b2b3c5 (diff)
downloadcpython-git-d0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc.tar.gz
Set cache sizes to a power-of-two
Diffstat (limited to 'Lib/re.py')
-rw-r--r--Lib/re.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/re.py b/Lib/re.py
index 9ae51740e4..952b60f45b 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -261,7 +261,7 @@ def escape(pattern):
_pattern_type = type(sre_compile.compile("", 0))
-@functools.lru_cache(maxsize=500, typed=True)
+@functools.lru_cache(maxsize=512, typed=True)
def _compile(pattern, flags):
# internal: compile pattern
if isinstance(pattern, _pattern_type):
@@ -273,7 +273,7 @@ def _compile(pattern, flags):
raise TypeError("first argument must be string or compiled pattern")
return sre_compile.compile(pattern, flags)
-@functools.lru_cache(maxsize=500)
+@functools.lru_cache(maxsize=512)
def _compile_repl(repl, pattern):
# internal: compile replacement pattern
return sre_parse.parse_template(repl, pattern)