From a57a6fa28dc08d52268814b81f80e3814eb060b6 Mon Sep 17 00:00:00 2001 From: DeadNews Date: Sun, 4 Feb 2024 12:47:30 +0200 Subject: [PATCH] Fix typing: ignore `mypy` runtime error (#2) ref: `mypy` crashes on `stgpytools/types/utils.py` #1 --- stgpytools/types/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stgpytools/types/utils.py b/stgpytools/types/utils.py index 1818a35..6e3d355 100644 --- a/stgpytools/types/utils.py +++ b/stgpytools/types/utils.py @@ -6,7 +6,7 @@ from inspect import isclass from typing import ( TYPE_CHECKING, Any, Callable, Concatenate, Generator, Generic, Iterable, Iterator, Mapping, NoReturn, Protocol, - Sequence, TypeVar, cast, overload + Sequence, TypeVar, cast, overload, no_type_check ) from .builtins import F0, F1, P0, P1, R0, R1, T0, T1, T2, KwargsT, P, R, T @@ -426,6 +426,7 @@ def __setattr__(self, key: str, value: Any) -> None: return super(classproperty.metaclass, self).__setattr__(key, value) + @no_type_check def __init__( self, fget: classmethod[T, P, R] | Callable[P, R], @@ -452,6 +453,7 @@ def getter(self, __fget: classmethod[T, P, R] | Callable[P1, R1]) -> classproper self.fget = self._wrap(__fget) # type: ignore return self # type: ignore + @no_type_check def setter(self, __fset: classmethod[T1, P, None] | Callable[[T1, T2], None]) -> classproperty[P, R, T1, T2, P0]: self.fset = self._wrap(__fset) # type: ignore return self # type: ignore