mypy infers numpy.float64
instead of Any
for numpy.ndarray.__iter__
in numpy 2.2.2
#18566
Labels
numpy.float64
instead of Any
for numpy.ndarray.__iter__
in numpy 2.2.2
#18566
Bug Report
It looks like mypy doesn't correctly handle the overloading of
numpy.ndarray.__iter__
. In the example below mypy infersnumpy.float64
forai
while the correct type isAny
.See also: numpy/numpy#28245
To Reproduce
Expected Behavior
Any
Actual Behavior
test.py:7: note: Revealed type is "numpy.float64"
Your Environment
Both pyright 1.1.392 and basedpyright 1.25.0 behave as expected.
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: