diff options
author | Guido van Rossum <guido@python.org> | 2016-11-09 21:23:06 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-11-09 21:23:06 (GMT) |
commit | ea446e2f2a7917ca094cc515cb843a5d3e97d8b2 (patch) | |
tree | e99eb3fc76bffe26c8709b1f0c1692276c770a24 /Lib | |
parent | 45b09cacdea96bf996a9b1dc0bd87f9651ab9fb8 (diff) | |
parent | 5486a8842717def49a592dfdae89f831aeb1277c (diff) | |
download | cpython-ea446e2f2a7917ca094cc515cb843a5d3e97d8b2.zip cpython-ea446e2f2a7917ca094cc515cb843a5d3e97d8b2.tar.gz cpython-ea446e2f2a7917ca094cc515cb843a5d3e97d8b2.tar.bz2 |
Issue #28649: typing-clear-caches.patch (3.6->3.7)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/typing.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py index e748fd9..f3e446e 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -611,12 +611,16 @@ def _check_generic(cls, parameters): ("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: |