Skip to content

Add type annotations to connection.py and keyboard.py#600

Merged
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/connection-var-annotated
Mar 2, 2026
Merged

Add type annotations to connection.py and keyboard.py#600
gnachman merged 1 commit intognachman:masterfrom
mkusaka:fix/connection-var-annotated

Conversation

@mkusaka
Copy link
Contributor

@mkusaka mkusaka commented Mar 2, 2026

Summary

Two missing/invalid type annotations in the Python API:

  • connection.py:11: gDisconnectCallbacks declared as bare [] without type annotation. mypy reports [var-annotated]. Annotated as typing.List[typing.Callable[[], None]].

  • keyboard.py:26: Modifier.from_cocoa return type uses bare list syntax ['Modifier'] instead of typing.List['Modifier']. mypy reports [valid-type].

- connection.py: Annotate gDisconnectCallbacks with
  typing.List[typing.Callable[[], None]] to satisfy mypy var-annotated.

- keyboard.py: Fix Modifier.from_cocoa return type from bare ['Modifier']
  to typing.List['Modifier'] to satisfy mypy valid-type.
@gnachman gnachman merged commit 7803280 into gnachman:master Mar 2, 2026
2 checks passed
@mkusaka mkusaka deleted the fix/connection-var-annotated branch March 3, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants