Problems with "expected overloaded function" when method hinted via Callback Protocol (⇝numpy
)
#18101
Labels
bug
mypy got something wrong
numpy
)
#18101
Bug Report
mypy
complains about expecting an overloaded function, when a method is hinted by a Callback-Protocol. This technique is used in thenumpy
stubs, and causesmypy
to complain when trying to describe numpy scalars with simple protocols.To Reproduce
Below is a MWE [mypy-playground], based on how the numpy stubs declare the methods on scalars. Note that [pyright-playground] does not report any issues.
Concrete example with
numpy==2.1.3
(again,pyright
reports no errors):The text was updated successfully, but these errors were encountered: