Skip to content

How to correctly annotated the key builder in Pycharm #454

Open
@allen0099

Description

@allen0099

How to annoate cache decorator with key builder, even I use the default builer, it still show warning in pycharm.
image

The message:

Expected type 'KeyBuilder | None', got '(func: (...) -> Any, namespace: str, Any, request: Request | None, response: Response | None, args: tuple[Any, ...], kwargs: dict[str, Any]) -> str' instead 

image


Python version: 3.11
fastapi-cache2 version: 0.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions