Skip to content

Commit

Permalink
Fix typing: ignore mypy runtime error (#2)
Browse files Browse the repository at this point in the history
ref: `mypy` crashes on `stgpytools/types/utils.py` #1
  • Loading branch information
DeadNews authored Feb 4, 2024
1 parent 8a0e4e7 commit a57a6fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stgpytools/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand All @@ -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
Expand Down

0 comments on commit a57a6fa

Please sign in to comment.