Mark up the class variables as such

There is never an instance of this class, so these are not instance attributes.
This commit is contained in:
Martijn Pieters
2023-04-27 16:15:06 +01:00
parent 32acafa5e0
commit 0d0fe1f0d0

View File

@@ -1,4 +1,4 @@
from typing import Callable, Optional, Type
from typing import Callable, ClassVar, Optional, Type
from fastapi_cache.backends import Backend
from fastapi_cache.coder import Coder, JsonCoder
@@ -6,13 +6,13 @@ from fastapi_cache.key_builder import default_key_builder
class FastAPICache:
_backend: Optional[Backend] = None
_prefix: Optional[str] = None
_expire: Optional[int] = None
_init = False
_coder: Optional[Type[Coder]] = None
_key_builder: Optional[Callable] = None
_enable = True
_backend: ClassVar[Optional[Backend]] = None
_prefix: ClassVar[Optional[str]] = None
_expire: ClassVar[Optional[int]] = None
_init: ClassVar[bool] = False
_coder: ClassVar[Optional[Type[Coder]]] = None
_key_builder: ClassVar[Optional[Callable]] = None
_enable: ClassVar[bool] = True
@classmethod
def init(