Skip to content

Commit ecf2e07

Browse files
committed
TYP: positional-only binop parameters in numpy.poly1d
1 parent 3f71d09 commit ecf2e07

File tree

1 file changed

+41
-33
lines changed

1 file changed

+41
-33
lines changed

numpy/__init__.pyi

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,19 +3763,19 @@ class poly1d:
37633763
def __len__(self) -> int: ...
37643764
def __neg__(self) -> poly1d: ...
37653765
def __pos__(self) -> poly1d: ...
3766-
def __mul__(self, other: ArrayLike) -> poly1d: ...
3767-
def __rmul__(self, other: ArrayLike) -> poly1d: ...
3768-
def __add__(self, other: ArrayLike) -> poly1d: ...
3769-
def __radd__(self, other: ArrayLike) -> poly1d: ...
3770-
def __pow__(self, val: _FloatLike_co) -> poly1d: ... # Integral floats are accepted
3771-
def __sub__(self, other: ArrayLike) -> poly1d: ...
3772-
def __rsub__(self, other: ArrayLike) -> poly1d: ...
3773-
def __div__(self, other: ArrayLike) -> poly1d: ...
3774-
def __truediv__(self, other: ArrayLike) -> poly1d: ...
3775-
def __rdiv__(self, other: ArrayLike) -> poly1d: ...
3776-
def __rtruediv__(self, other: ArrayLike) -> poly1d: ...
3777-
def __getitem__(self, val: int) -> Any: ...
3778-
def __setitem__(self, key: int, val: Any) -> None: ...
3766+
def __mul__(self, other: ArrayLike, /) -> poly1d: ...
3767+
def __rmul__(self, other: ArrayLike, /) -> poly1d: ...
3768+
def __add__(self, other: ArrayLike, /) -> poly1d: ...
3769+
def __radd__(self, other: ArrayLike, /) -> poly1d: ...
3770+
def __pow__(self, val: _FloatLike_co, /) -> poly1d: ... # Integral floats are accepted
3771+
def __sub__(self, other: ArrayLike, /) -> poly1d: ...
3772+
def __rsub__(self, other: ArrayLike, /) -> poly1d: ...
3773+
def __div__(self, other: ArrayLike, /) -> poly1d: ...
3774+
def __truediv__(self, other: ArrayLike, /) -> poly1d: ...
3775+
def __rdiv__(self, other: ArrayLike, /) -> poly1d: ...
3776+
def __rtruediv__(self, other: ArrayLike, /) -> poly1d: ...
3777+
def __getitem__(self, val: int, /) -> Any: ...
3778+
def __setitem__(self, key: int, val: Any, /) -> None: ...
37793779
def __iter__(self) -> Iterator[Any]: ...
37803780
def deriv(self, m: SupportsInt | SupportsIndex = ...) -> poly1d: ...
37813781
def integ(
@@ -3795,30 +3795,38 @@ class matrix(ndarray[_ShapeType, _DType_co]):
37953795
def __array_finalize__(self, obj: object) -> None: ...
37963796

37973797
@overload
3798-
def __getitem__(self, key: (
3799-
SupportsIndex
3800-
| _ArrayLikeInt_co
3801-
| tuple[SupportsIndex | _ArrayLikeInt_co, ...]
3802-
)) -> Any: ...
3798+
def __getitem__(
3799+
self,
3800+
key: (
3801+
SupportsIndex
3802+
| _ArrayLikeInt_co
3803+
| tuple[SupportsIndex | _ArrayLikeInt_co, ...]
3804+
),
3805+
/,
3806+
) -> Any: ...
38033807
@overload
3804-
def __getitem__(self, key: (
3805-
None
3806-
| slice
3807-
| ellipsis
3808-
| SupportsIndex
3809-
| _ArrayLikeInt_co
3810-
| tuple[None | slice | ellipsis | _ArrayLikeInt_co | SupportsIndex, ...]
3811-
)) -> matrix[Any, _DType_co]: ...
3808+
def __getitem__(
3809+
self,
3810+
key: (
3811+
None
3812+
| slice
3813+
| ellipsis
3814+
| SupportsIndex
3815+
| _ArrayLikeInt_co
3816+
| tuple[None | slice | ellipsis | _ArrayLikeInt_co | SupportsIndex, ...]
3817+
),
3818+
/,
3819+
) -> matrix[Any, _DType_co]: ...
38123820
@overload
3813-
def __getitem__(self: NDArray[void], key: str) -> matrix[Any, dtype[Any]]: ...
3821+
def __getitem__(self: NDArray[void], key: str, /) -> matrix[Any, dtype[Any]]: ...
38143822
@overload
3815-
def __getitem__(self: NDArray[void], key: list[str]) -> matrix[_ShapeType, dtype[void]]: ...
3823+
def __getitem__(self: NDArray[void], key: list[str], /) -> matrix[_ShapeType, dtype[void]]: ...
38163824

3817-
def __mul__(self, other: ArrayLike) -> matrix[Any, Any]: ...
3818-
def __rmul__(self, other: ArrayLike) -> matrix[Any, Any]: ...
3819-
def __imul__(self, other: ArrayLike) -> matrix[_ShapeType, _DType_co]: ...
3820-
def __pow__(self, other: ArrayLike) -> matrix[Any, Any]: ...
3821-
def __ipow__(self, other: ArrayLike) -> matrix[_ShapeType, _DType_co]: ...
3825+
def __mul__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
3826+
def __rmul__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
3827+
def __imul__(self, other: ArrayLike, /) -> matrix[_ShapeType, _DType_co]: ...
3828+
def __pow__(self, other: ArrayLike, /) -> matrix[Any, Any]: ...
3829+
def __ipow__(self, other: ArrayLike, /) -> matrix[_ShapeType, _DType_co]: ...
38223830

38233831
@overload
38243832
def sum(self, axis: None = ..., dtype: DTypeLike = ..., out: None = ...) -> Any: ...

0 commit comments

Comments
 (0)