Skip to content

Commit

Permalink
fix some mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ichunjo authored and Setsugennoao committed Aug 21, 2024
1 parent 7076f0d commit 69e544b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stgpytools/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
...

Expand Down Expand Up @@ -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]):
Expand Down Expand Up @@ -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]):
Expand Down

0 comments on commit 69e544b

Please sign in to comment.