mirror of
https://github.com/beetbox/beets.git
synced 2026-02-08 08:25:23 +01:00
use _cache as a ClassVar
This commit is contained in:
parent
1f5a751954
commit
ed0f50d2af
1 changed files with 3 additions and 3 deletions
|
|
@ -1069,7 +1069,7 @@ class cached_classproperty(Generic[T, T2]):
|
|||
instance properties, this operates on the class rather than instances.
|
||||
"""
|
||||
|
||||
_cache: dict[tuple[type[T], str], T2] = {}
|
||||
_cache: ClassVar[dict[tuple[type[object], str], object]] = {}
|
||||
|
||||
name: str = ""
|
||||
|
||||
|
|
@ -1106,9 +1106,9 @@ class cached_classproperty(Generic[T, T2]):
|
|||
owner = cast(type[T], owner)
|
||||
key: tuple[type[T], str] = owner, self.name
|
||||
if key not in self._cache:
|
||||
self._cache[key] = self.getter(owner)
|
||||
cached_classproperty._cache[key] = self.getter(owner)
|
||||
|
||||
return self._cache[key]
|
||||
return cast(T2, cached_classproperty._cache[key])
|
||||
|
||||
@classmethod
|
||||
def clear_cache(cls) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue