-
Notifications
You must be signed in to change notification settings - Fork 120
Closed
Description
As of v1.9.1 categorize (
python-evdev/src/evdev/util.py
Line 35 in 82d09f6
| def categorize(event: InputEvent) -> InputEvent: |
is typed to return
InputEvent which is correct if it cannot be categorized but wrong in all other cases.
A quick fix would be to change the return value to InputEvent | KeyEvent | RelEvent | AbsEvent | SynEvent.
There are probably more involved solutions that help tools like mypy to narrow down the value correctly.
I would be willing to set up a PR if this is wanted.
Metadata
Metadata
Assignees
Labels
No labels