-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
TYP: incorrect array_finalize definition in ndarray for subclassing #20756
Copy link
Copy link
Closed
Description
Lines 1505 to 1506 in 4adc87d
| @property | |
| def __array_finalize__(self) -> None: ... |
Currently, mypy does not allow users to define __array_finalize__, since the super class (ndarray) does not have an argument. So the following error is produced:
src/vector/_backends/numpy_.py:899: error: Signature of "__array_finalize__" incompatible with supertype "ndarray" [override]
src/vector/_backends/numpy_.py:899: note: Superclass:
src/vector/_backends/numpy_.py:899: note: def __array_finalize__(self) -> None
src/vector/_backends/numpy_.py:899: note: Subclass:
src/vector/_backends/numpy_.py:899: note: def __array_finalize__(self, obj: Any) -> None
This type stub should have a obj: Any argument.
Reactions are currently unavailable