mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-18 15:54:13 +08:00
Reduce use of deprecated typing aliases (#6358)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user