Skip to content

Fix stubtest errors for __init__ / __new__ - #2487

Merged
WyattBlue merged 1 commit into
PyAV-Org:masterfrom
jorenham:typing/stubtest-__init__-errors
Oct 26, 2026
Merged

WyattBlue merged 1 commit into
PyAV-Org:masterfrom
jorenham:typing/stubtest-__init__-errors

Conversation

@jorenham

Copy link
Copy Markdown
Contributor

This fixes the following stubtest errors:

av.audio.format.AudioFormat.__init__ is inconsistent, runtime does not have parameter "name". You may need to write stubs for __new__ instead of __init__.
av.audio.frame.AudioFrame.__init__ is inconsistent, runtime does not have parameter "format". You may need to write stubs for __new__ instead of __init__.
av.audio.frame.AudioFrame.__init__ is inconsistent, runtime does not have parameter "layout". You may need to write stubs for __new__ instead of __init__.
av.audio.frame.AudioFrame.__init__ is inconsistent, runtime does not have parameter "samples". You may need to write stubs for __new__ instead of __init__.
av.audio.frame.AudioFrame.__init__ is inconsistent, runtime does not have parameter "align". You may need to write stubs for __new__ instead of __init__.
av.audio.layout.AudioLayout.__init__ is inconsistent, runtime does not have parameter "layout". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "format". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "layout". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "rate". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "frame_size". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "options". You may need to write stubs for __new__ instead of __init__.
av.audio.resampler.AudioResampler.__init__ is inconsistent, runtime does not have parameter "threads". You may need to write stubs for __new__ instead of __init__.
av.bitstream.BitStreamFilterContext.__init__ is inconsistent, runtime does not have parameter "filter_description". You may need to write stubs for __new__ instead of __init__.
av.bitstream.BitStreamFilterContext.__init__ is inconsistent, runtime does not have parameter "in_stream". You may need to write stubs for __new__ instead of __init__.
av.bitstream.BitStreamFilterContext.__init__ is inconsistent, runtime does not have parameter "out_stream". You may need to write stubs for __new__ instead of __init__.
av.codec.codec.Codec.__init__ is inconsistent, runtime does not have parameter "name". You may need to write stubs for __new__ instead of __init__.
av.codec.codec.Codec.__init__ is inconsistent, runtime does not have parameter "mode". You may need to write stubs for __new__ instead of __init__.
av.filter.filter.Filter.__init__ is inconsistent, runtime does not have parameter "name". You may need to write stubs for __new__ instead of __init__.
av.filter.graph.Graph.__init__ is inconsistent, runtime does not have parameter "hw_device". You may need to write stubs for __new__ instead of __init__.
av.format.ContainerFormat.__init__ is inconsistent, runtime does not have parameter "name". You may need to write stubs for __new__ instead of __init__.
av.format.ContainerFormat.__init__ is inconsistent, runtime does not have parameter "mode". You may need to write stubs for __new__ instead of __init__.
av.plane.Plane.__init__ is inconsistent, runtime does not have parameter "frame". You may need to write stubs for __new__ instead of __init__.
av.plane.Plane.__init__ is inconsistent, runtime does not have parameter "index". You may need to write stubs for __new__ instead of __init__.
av.video.format.VideoFormat.__init__ is inconsistent, runtime does not have parameter "name". You may need to write stubs for __new__ instead of __init__.
av.video.format.VideoFormat.__init__ is inconsistent, runtime does not have parameter "width". You may need to write stubs for __new__ instead of __init__.
av.video.format.VideoFormat.__init__ is inconsistent, runtime does not have parameter "height". You may need to write stubs for __new__ instead of __init__.
av.video.format.VideoFormatComponent.__init__ is inconsistent, runtime does not have parameter "format". You may need to write stubs for __new__ instead of __init__.
av.video.format.VideoFormatComponent.__init__ is inconsistent, runtime does not have parameter "index". You may need to write stubs for __new__ instead of __init__.
av.video.frame.CudaContext.__init__ is inconsistent, runtime does not have parameter "device_id". You may need to write stubs for __new__ instead of __init__.
av.video.frame.CudaContext.__init__ is inconsistent, runtime does not have parameter "primary_ctx". You may need to write stubs for __new__ instead of __init__.
av.video.frame.CudaContext.__init__ is inconsistent, runtime does not have parameter "current_ctx". You may need to write stubs for __new__ instead of __init__.
av.video.frame.CudaContext.__init__ is inconsistent, runtime does not have parameter "cuda_stream". You may need to write stubs for __new__ instead of __init__.
av.video.frame.VideoFrame.__init__ is inconsistent, runtime does not have parameter "width". You may need to write stubs for __new__ instead of __init__.
av.video.frame.VideoFrame.__init__ is inconsistent, runtime does not have parameter "height". You may need to write stubs for __new__ instead of __init__.
av.video.frame.VideoFrame.__init__ is inconsistent, runtime does not have parameter "format". You may need to write stubs for __new__ instead of __init__.
av.video.plane.VideoPlane.__init__ is inconsistent, runtime does not have parameter "frame". You may need to write stubs for __new__ instead of __init__.
av.video.plane.VideoPlane.__init__ is inconsistent, runtime does not have parameter "index". You may need to write stubs for __new__ instead of __init__.

FWIW; I was pretty confused by this when I encountered similar stubtest errors a while back in scipy-stubs. I just didn't expect __cinit__ to result in a __new__ instead of an __init__: python/mypy#19732

@WyattBlue
WyattBlue merged commit dd064c9 into PyAV-Org:master Oct 26, 2026
1 check passed
@jorenham
jorenham deleted the typing/stubtest-__init__-errors branch October 26, 2026 17:10
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