summaryrefslogtreecommitdiff
path: root/urwid/widget.py
diff options
context:
space:
mode:
authorAlexey Stepanov <penguinolog@users.noreply.github.com>2023-04-06 13:28:21 +0200
committerGitHub <noreply@github.com>2023-04-06 13:28:21 +0200
commit0c0ea377ab9b418cbb5233fa6e178dd05f1f4e5a (patch)
tree605aec7db0b4849525051aa094cb4289cacc9b09 /urwid/widget.py
parent02d0fd689731d957f360858d3e3244a4c36166fb (diff)
downloadurwid-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.py6
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