diff --git a/fastapi_cache/decorator.py b/fastapi_cache/decorator.py index 625b69c..2c06ad2 100644 --- a/fastapi_cache/decorator.py +++ b/fastapi_cache/decorator.py @@ -17,7 +17,7 @@ from fastapi_cache import FastAPICache from fastapi_cache.coder import Coder from fastapi_cache.types import KeyBuilder -logger = logging.getLogger(__name__) +logger: logging.Logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) P = ParamSpec("P") R = TypeVar("R") diff --git a/fastapi_cache/key_builder.py b/fastapi_cache/key_builder.py index a43317c..c588889 100644 --- a/fastapi_cache/key_builder.py +++ b/fastapi_cache/key_builder.py @@ -1,17 +1,17 @@ import hashlib -from typing import Callable, Optional +from typing import Any, Callable, Optional from starlette.requests import Request from starlette.responses import Response def default_key_builder( - func: Callable, + func: Callable[..., Any], namespace: str = "", request: Optional[Request] = None, response: Optional[Response] = None, - args: Optional[tuple] = None, - kwargs: Optional[dict] = None, + args: Optional[tuple[Any, ...]] = None, + kwargs: Optional[dict[str, Any]] = None, ) -> str: from fastapi_cache import FastAPICache