Skip to content

Commit 9356b32

Browse files
committed
refactor: fix some mypy errors
1 parent 59848e2 commit 9356b32

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

robotcode/utils/async_tools.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
_T = TypeVar("_T")
3838

39+
# TODO try to use new ParamSpec feature in Python 3.10
40+
3941
_TResult = TypeVar("_TResult")
4042
_TCallable = TypeVar("_TCallable", bound=Callable[..., Any])
4143

@@ -145,12 +147,12 @@ class async_event_iterator( # noqa: N801
145147
AsyncEventDescriptorBase[_TCallable, Any, AsyncEventIterator[_TCallable, Any]]
146148
):
147149
def __init__(self, _func: _TCallable) -> None:
148-
super().__init__(_func, AsyncEventIterator[_TCallable, _TResult])
150+
super().__init__(_func, AsyncEventIterator[_TCallable, Any])
149151

150152

151153
class async_event(AsyncEventDescriptorBase[_TCallable, Any, AsyncEvent[_TCallable, Any]]): # noqa: N801
152154
def __init__(self, _func: _TCallable) -> None:
153-
super().__init__(_func, AsyncEvent[_TCallable, _TResult])
155+
super().__init__(_func, AsyncEvent[_TCallable, Any])
154156

155157

156158
_F = TypeVar("_F", bound=Callable[..., Any])

robotcode/utils/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def __get__(self, obj: Any, objtype: Type[Any]) -> _TEvent:
113113

114114
class event_iterator(EventDescriptorBase[_TCallable, Any, EventIterator[_TCallable, Any]]): # noqa: N801
115115
def __init__(self, _func: _TCallable) -> None:
116-
super().__init__(_func, EventIterator[_TCallable, _TResult])
116+
super().__init__(_func, EventIterator[_TCallable, Any])
117117

118118

119119
class event(EventDescriptorBase[_TCallable, Any, Event[_TCallable, Any]]): # noqa: N801
120120
def __init__(self, _func: _TCallable) -> None:
121-
super().__init__(_func, Event[_TCallable, _TResult])
121+
super().__init__(_func, Event[_TCallable, Any])

0 commit comments

Comments
 (0)