Skip to content

Mark Cython classes @final and dunder parameters positional-only in stubs - #2465

Merged
WyattBlue merged 1 commit into
masterfrom
stubtest-final
Oct 24, 2026
Merged

WyattBlue merged 1 commit into
masterfrom
stubtest-final

Conversation

@WyattBlue

Copy link
Copy Markdown
Member

Fixes 53 stubtest errors:

  • 34 × X cannot be subclassed at runtime, but isn't marked with @final in the stub: added @final to every Cython class stubtest flagged, across 26 stubs (frames, planes, streams, formats, layouts, Codec, Packet, AVRational, filter classes, and others).
  • 19 × stub parameter "x" should be positional-only: added / to AVRational's comparison and arithmetic dunders (every overload included), Dictionary.__getitem__/__setitem__/__delitem__, IndexEntries.__getitem__, and FilterPad.__eq__.

Stubtest reports none of these afterwards and no new errors. mypy av tests is unchanged, and the test suite passes.

The @disjoint_base errors (also 34) are left alone; that decorator is new in typing_extensions and optional.

… stubs

Fixes the stubtest errors for 34 classes that cannot be subclassed at
runtime and 19 dunder methods whose parameters are positional-only.
@WyattBlue
WyattBlue merged commit c7a036d into master Oct 24, 2026
1 check passed
@WyattBlue
WyattBlue deleted the stubtest-final branch October 24, 2026 16: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.

1 participant