[Python-checkins] cpython (merge 3.6 -> default): Issue #28649: typing-clear-caches.patch (3.6->3.7)
guido.van.rossum
python-checkins at python.org
Wed Nov 9 16:23:59 EST 2016
https://hg.python.org/cpython/rev/08f76f89d199
changeset: 105026:08f76f89d199
parent: 105023:fd47a9d791b9
parent: 105025:bd2ec9965f47
user: Guido van Rossum <guido at python.org>
date: Wed Nov 09 13:23:06 2016 -0800
summary:
Issue #28649: typing-clear-caches.patch (3.6->3.7)
files:
Lib/typing.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Lib/typing.py b/Lib/typing.py
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -611,12 +611,16 @@
("many" if alen > elen else "few", repr(cls), alen, elen))
+_cleanups = []
+
+
def _tp_cache(func):
""" Caching for __getitem__ of generic types with a fallback to
original function for non-hashable arguments.
"""
cached = functools.lru_cache()(func)
+ _cleanups.append(cached.cache_clear)
@functools.wraps(func)
def inner(*args, **kwds):
try:
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list