Skip to content

Commit a0f9914

Browse files
committed
🚨 fix ruff ANN401 errors in the numpy legacy tests
1 parent f80b1a0 commit a0f9914

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

‎src/numpy-stubs/@test/runtime/legacy/arithmetic.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from __future__ import annotations
2-
3-
from typing import Any
1+
from typing import Self
42

53
import pytest
64

@@ -38,28 +36,28 @@ def __array__(
3836
ret[()] = self
3937
return ret
4038

41-
def __sub__(self, value: Any) -> Object:
39+
def __sub__(self, value: object) -> Self:
4240
return self
4341

44-
def __rsub__(self, value: Any) -> Object:
42+
def __rsub__(self, value: object) -> Self:
4543
return self
4644

47-
def __floordiv__(self, value: Any) -> Object:
45+
def __floordiv__(self, value: object) -> Self:
4846
return self
4947

50-
def __rfloordiv__(self, value: Any) -> Object:
48+
def __rfloordiv__(self, value: object) -> Self:
5149
return self
5250

53-
def __mul__(self, value: Any) -> Object:
51+
def __mul__(self, value: object) -> Self:
5452
return self
5553

56-
def __rmul__(self, value: Any) -> Object:
54+
def __rmul__(self, value: object) -> Self:
5755
return self
5856

59-
def __pow__(self, value: Any) -> Object:
57+
def __pow__(self, value: object) -> Self:
6058
return self
6159

62-
def __rpow__(self, value: Any) -> Object:
60+
def __rpow__(self, value: object) -> Self:
6361
return self
6462

6563

‎src/numpy-stubs/@test/runtime/legacy/array_constructors.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Any
2-
31
import numpy as np
42
import numpy.typing as npt
53

@@ -13,7 +11,7 @@ class SubClass(npt.NDArray[np.float64]):
1311
pass
1412

1513

16-
def func(i: int, j: int, **kwargs: Any) -> SubClass:
14+
def func(i: int, j: int, **kwargs: object) -> SubClass:
1715
return B
1816

1917

0 commit comments

Comments
 (0)