Skip to content

Commit b7e8cf4

Browse files
committed
fixes
1 parent 9fdea60 commit b7e8cf4

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

py_cashier/_decorators.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from asyncio import iscoroutinefunction
44
from functools import wraps
5-
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar, cast, overload
5+
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar, cast
66

77
from typing_extensions import ParamSpec
88

@@ -30,24 +30,10 @@ class PStorage(Protocol[T, TLock]):
3030
def __call__(self) -> BaseStorage[T, TLock]: ...
3131

3232

33-
@overload
3433
def cache(
3534
*,
3635
storage: PStorage[T, TLock],
3736
key_builder: PKeyBuilder | None = None,
38-
) -> Callable[[F], F]: ...
39-
40-
41-
@overload
42-
def cache(func: F, /) -> F: ...
43-
44-
45-
def cache(
46-
func: F | None = None,
47-
/,
48-
*,
49-
storage: PStorage[T, TLock],
50-
key_builder: PKeyBuilder | None = None,
5137
) -> Callable[[F], F]:
5238
"""Cache decorator."""
5339

@@ -64,10 +50,7 @@ def _decorator(f: F) -> F:
6450
_wrapper(func=f, storage=storage, key_builder=k), # type: ignore[misc]
6551
)
6652

67-
if func is None:
68-
return _decorator
69-
70-
return _decorator(func)
53+
return _decorator
7154

7255

7356
def _wrapper(

0 commit comments

Comments
 (0)