Skip to content

stubtest: incorrect runtime signature of cython __cinit__ methods #19732

@jorenham

Description

@jorenham

Originally posted in #19307 (comment) (slightly edited):


I'm seeing a bunch of new errors pop up when running stubtest on scipy-stubs using mypy master (ffe2db8).

All errors are seem to be related to __cinit__ Cython methods:

Each parameter is reported as a separate error, and aliases are counted double, which causes 75 errors to be reported here.

I must admit that I know very little about cython and the C-side of cpython, so I'm not able to see why this is happening. But the fact that these only occur in case of these __cinit__ methods is kinda sus afaik.

Oh and here are the errors: https://gist.github.com/jorenham/3d41e79607bcc1f45267acc1566833d2

This might also be relevant infomation:

>>> from scipy.stats._unuran.unuran_wrapper import TransformedDensityRejection
>>> TransformedDensityRejection.__init__.__text_signature__
'($self, /, *args, **kwargs)'

So it's kinda odd that stubtest says it's def (self) at runtime, right?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions