Skip to content

Correct documented OSC callback argument types - #198

Merged
attwad merged 1 commit into
attwad:mainfrom
ac1982:docs/callback-argument-types
Oct 17, 2026
Merged

attwad merged 1 commit into
attwad:mainfrom
ac1982:docs/callback-argument-types

Conversation

@ac1982

@ac1982 ac1982 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #195.

Annotate each variadic OSC callback argument with the existing ArgValue alias in the dispatcher guide and Dispatcher.map docstring. The previous *args: List[Any] annotation makes the documented float calls fail type checking. Keep fixed arguments typed as a separate list, explain that distinction, and make the callback signature examples valid Python and ReST.

Validation on Python 3.12/Linux ARM64:

  • The original guide's callback rejects two float arguments in mypy; the corrected example passes and runs over actual loopback UDP.
  • All four callback signatures work with real encoded packets, both synchronously and asynchronously, including scalars, blobs, nil, MIDI and nested arrays.
  • 181 tests pass; Ruff check/format, mypy on 42 files, package build and an isolated installed-wheel typing check pass.
  • Changed-file pre-commit checks pass. Full pre-commit has the same eight mypy errors on the unmodified baseline because its isolated hook lacks pytest; the project environment's mypy check passes.
  • Sphinx diagnostics decrease from 15 to 9, removing the map signature rendering errors. Remaining baseline errors/warnings mean the full documentation build still fails warnings-as-errors.

No runtime behavior changes. Other platforms and Python versions were not tested locally. Prepared with OpenAI Codex assistance.

@attwad
attwad merged commit b3e7436 into attwad:main Oct 17, 2026
5 checks passed
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.

Type signature for callbacks does not follow PEP

2 participants