mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
Use complete type hints with all generic parameters filled
This makes the core fastapi_cache pass all strict type checker tests.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user