Skip to content

stubs: type stubs for the twelve remaining modules - #404

Merged
bdbarnett merged 1 commit into
mainfrom
stubs-rest
Nov 10, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
stubs-rest

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Every native module now has a .pyi stub: audiobiquad, audiodelays, audiodynamics, audioecho, audiofilters, audiofreeverb, audiograph, audioladder, audiomixer, audioshaper, audiospeed and audioverb join the thirteen that had one. An editor completes their constructors, options, properties and constants, including audiograph's node kinds and the Mixer and node ramp options, and the wheel ships the stubs like the others. The stub test now covers all 25 modules, and the roadmap's stub item is removed.

Each stub was written from the C source's globals and locals tables and argument parsing, so where a hand-written page disagreed the source won. The stubs' docstrings carry the behaviour those pages describe, ready for the Reference pages to be generated from them.

I ran mypy 2.4.1 over each stub, and the stub test against a MicroPython build that predates the level-ramp change: it passes for every module except Mixer.level_ramp, which that build lacks, and renaming one method in a stub made it fail in both directions. I did not run the CPython half or the exact MicroPython half against a current build; the clean-build job does both.

@bdbarnett
bdbarnett merged commit 5be81c8 into main Nov 10, 2026
39 checks passed
@bdbarnett
bdbarnett deleted the stubs-rest branch November 10, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant