Reduce use of deprecated typing aliases (#6358)

This commit is contained in:
Alex Waygood authored and GitHub committed 2021-11-23 10:56:43 +01:00
1 parent 7e836db2f3
commit c685c2d6c6
19 files changed
+64 -61

No files matched your search

+4 -3
View File
@@ -1,6 +1,7 @@
from _typeshed import IdentityFunction
from collections.abc import Iterator, Sequence
from typing import Any, Callable, ContextManager, Generic, MutableMapping, TypeVar, overload
from contextlib import AbstractContextManager
from typing import Any, Callable, Generic, MutableMapping, TypeVar, overload
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")
@@ -57,10 +58,10 @@ class TTLCache(Cache[_KT, _VT]):
def expire(self, time: float | None = ...) -> None: ...
def cached(
cache: MutableMapping[_KT, Any] | None, key: Callable[..., _KT] = ..., lock: ContextManager[Any] | None = ...
cache: MutableMapping[_KT, Any] | None, key: Callable[..., _KT] = ..., lock: AbstractContextManager[Any] | None = ...
) -> IdentityFunction: ...
def cachedmethod(
cache: Callable[[Any], MutableMapping[_KT, Any] | None],
key: Callable[..., _KT] = ...,
lock: Callable[[Any], ContextManager[Any]] | None = ...,
lock: Callable[[Any], AbstractContextManager[Any]] | None = ...,
) -> IdentityFunction: ...