-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Milestone
Description
Describe the issue:
The type annotation for np.angle seems to assume the return value is a scalar, but if given an array it returns an array. This causes false positives from mypy.
Reproduce the code example:
import numpy as np
a = np.array([1.0 + 2.0j, 3.0 + 4.0j], dtype=np.dtype(complex))
ang = np.angle(a)
print(ang[0])Error message:
angle.py:5: error: Value of type "complexfloating[Any, Any]" is not indexableNumPy/Python version information:
1.23.1 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]