From 69e544b724d12eb4717747dc33e550d94cb2394b Mon Sep 17 00:00:00 2001 From: Ichunjo Date: Sat, 17 Aug 2024 02:36:55 +0200 Subject: [PATCH] fix some mypy errors --- stgpytools/types/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stgpytools/types/utils.py b/stgpytools/types/utils.py index 7987ce3..fee2c56 100644 --- a/stgpytools/types/utils.py +++ b/stgpytools/types/utils.py @@ -92,7 +92,7 @@ def __call__(cls: type[T], *args: P.args, **kwargs: P.kwargs) -> R: def __call__(cls: type[T], _cls: type[T], *args: P.args, **kwargs: P.kwargs) -> R: ... - @staticmethod # type: ignore + @staticmethod def __call__(*args: Any, **kwds: Any) -> Any: ... @@ -211,13 +211,13 @@ class cached(Generic[T0, P0, R0], inject_self_base[T0, P0, R0]): Once ``self`` is constructed, it will be reused. """ - class property(Generic[T0, R0]): - def __init__(self, function: Callable[[T0], R0]) -> None: + class property(Generic[T1, R1]): + def __init__(self, function: Callable[[T1], R1]) -> None: self.function = inject_self(function) def __get__( - self, class_obj: type[T0] | T0 | None, class_type: type[T0] | type[type[T0]] # type: ignore - ) -> R0: + self, class_obj: type[T1] | T1 | None, class_type: type[T1] | type[type[T1]] # type: ignore + ) -> R1: return self.function.__get__(class_obj, class_type)() class init_kwargs(Generic[T0, P0, R0], inject_self_base[T0, P0, R0]): @@ -502,7 +502,7 @@ def __delete__(self, __obj: Any) -> None: return self.fdel.__delete__(__obj, type_)(__obj) # type: ignore def __name__(self) -> str: - return self.fget.__name__ + return self.fget.__name__ # type: ignore class cachedproperty(property, Generic[P, R, T, T0, P0]):