diff options
author | Raymond Hettinger <python@rcn.com> | 2013-02-17 09:33:37 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2013-02-17 09:33:37 (GMT) |
commit | d0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc (patch) | |
tree | 7912db2e919fa3433d44ba5b500bb661d1701207 /Lib/re.py | |
parent | 5b49962f7e38a3c02db583a306fb717ae2b2b3c5 (diff) | |
download | cpython-d0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc.zip cpython-d0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc.tar.gz cpython-d0dbb20f5fcd5829f4bdc194d970d9e4d80e92bc.tar.bz2 |
Set cache sizes to a power-of-two
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |