diff options
author | Alexey Stepanov <penguinolog@users.noreply.github.com> | 2023-04-06 13:28:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 13:28:21 +0200 |
commit | 0c0ea377ab9b418cbb5233fa6e178dd05f1f4e5a (patch) | |
tree | 605aec7db0b4849525051aa094cb4289cacc9b09 /urwid/widget.py | |
parent | 02d0fd689731d957f360858d3e3244a4c36166fb (diff) | |
download | urwid-0c0ea377ab9b418cbb5233fa6e178dd05f1f4e5a.tar.gz |
Add extra type annotations (#532)
* add basic mypy config for better tracking
(now crazy amount of warnings without `strict`)
* Useless check in `raw_display` (`if not Popen` will be always `False`)
* use explicit `return None`
Partial: #406
Related: #512
Related: #408
Co-authored-by: Aleksei Stepanov <alekseis@nvidia.com>
Diffstat (limited to 'urwid/widget.py')
-rw-r--r-- | urwid/widget.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/urwid/widget.py b/urwid/widget.py index 52b8597..d5abf40 100644 --- a/urwid/widget.py +++ b/urwid/widget.py @@ -1845,7 +1845,7 @@ def delegate_to_widget_mixin(attribute_name: str): return CompositeCanvas(canv) @property - def selectable(self): + def selectable(self) -> Callable[[], bool]: return get_delegate(self).selectable @property @@ -1869,7 +1869,9 @@ def delegate_to_widget_mixin(attribute_name: str): return get_delegate(self).rows @property - def mouse_event(self): + def mouse_event( + self + ) -> Callable[[tuple[()] | tuple[int] | tuple[int, int], str, int, int, int, bool], bool | None]: return get_delegate(self).mouse_event @property |