From 0d0fe1f0d02d71d8047dfc963b6c2391457b472d Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Thu, 27 Apr 2023 16:15:06 +0100 Subject: [PATCH] Mark up the class variables as such There is never an instance of this class, so these are not instance attributes. --- fastapi_cache/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fastapi_cache/__init__.py b/fastapi_cache/__init__.py index b64eefe..42c585a 100644 --- a/fastapi_cache/__init__.py +++ b/fastapi_cache/__init__.py @@ -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(