Skip to content

Commit 80cf6f8

Browse files
committed
Make info parameter in cached overloads keyword-optional
1 parent ea350e1 commit 80cf6f8

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

stubs/cachetools/cachetools/__init__.pyi

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ from typing import Any, Generic, Literal, NamedTuple, TypeVar, overload
66
from typing_extensions import Self, deprecated
77

88
__all__ = ("Cache", "FIFOCache", "LFUCache", "LRUCache", "RRCache", "TLRUCache", "TTLCache", "cached", "cachedmethod")
9-
109
__version__: str
1110

1211
_KT = TypeVar("_KT")
@@ -121,24 +120,15 @@ def cached(
121120
key: Callable[..., _KT] = ...,
122121
lock: AbstractContextManager[Any] | None = None,
123122
condition: Condition | None = None,
124-
*,
125-
info: Literal[True],
123+
info: Literal[True] = ...,
126124
) -> Callable[[Callable[..., _R]], _cached_wrapper_info[_R]]: ...
127125
@overload
128126
def cached(
129127
cache: MutableMapping[_KT, Any] | None,
130128
key: Callable[..., _KT] = ...,
131129
lock: AbstractContextManager[Any] | None = None,
132130
condition: Condition | None = None,
133-
*,
134-
info: Literal[False] = False,
135-
) -> Callable[[Callable[..., _R]], _cached_wrapper[_R]]: ...
136-
@overload
137-
def cached( # без параметра info (по умолчанию False)
138-
cache: MutableMapping[_KT, Any] | None,
139-
key: Callable[..., _KT] = ...,
140-
lock: AbstractContextManager[Any] | None = None,
141-
condition: Condition | None = None,
131+
info: Literal[False] = ...,
142132
) -> Callable[[Callable[..., _R]], _cached_wrapper[_R]]: ...
143133
@overload
144134
@deprecated("Passing `info` as positional parameter is deprecated.")

0 commit comments

Comments
 (0)