Skip to content

Commit a6f4968

Browse files
committed
TYP: positional-only binop parameters in numpy.dtype
1 parent 6abbf5a commit a6f4968

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

numpy/__init__.pyi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -818,36 +818,36 @@ class dtype(Generic[_DTypeScalar_co]):
818818
def __class_getitem__(self, item: Any) -> GenericAlias: ...
819819

820820
@overload
821-
def __getitem__(self: dtype[void], key: list[builtins.str]) -> dtype[void]: ...
821+
def __getitem__(self: dtype[void], key: list[builtins.str], /) -> dtype[void]: ...
822822
@overload
823-
def __getitem__(self: dtype[void], key: builtins.str | SupportsIndex) -> dtype[Any]: ...
823+
def __getitem__(self: dtype[void], key: builtins.str | SupportsIndex, /) -> dtype[Any]: ...
824824

825825
# NOTE: In the future 1-based multiplications will also yield `flexible` dtypes
826826
@overload
827-
def __mul__(self: _DType, value: L[1]) -> _DType: ...
827+
def __mul__(self: _DType, value: L[1], /) -> _DType: ...
828828
@overload
829-
def __mul__(self: _FlexDType, value: SupportsIndex) -> _FlexDType: ...
829+
def __mul__(self: _FlexDType, value: SupportsIndex, /) -> _FlexDType: ...
830830
@overload
831-
def __mul__(self, value: SupportsIndex) -> dtype[void]: ...
831+
def __mul__(self, value: SupportsIndex, /) -> dtype[void]: ...
832832

833833
# NOTE: `__rmul__` seems to be broken when used in combination with
834834
# literals as of mypy 0.902. Set the return-type to `dtype[Any]` for
835835
# now for non-flexible dtypes.
836836
@overload
837-
def __rmul__(self: _FlexDType, value: SupportsIndex) -> _FlexDType: ...
837+
def __rmul__(self: _FlexDType, value: SupportsIndex, /) -> _FlexDType: ...
838838
@overload
839-
def __rmul__(self, value: SupportsIndex) -> dtype[Any]: ...
839+
def __rmul__(self, value: SupportsIndex, /) -> dtype[Any]: ...
840840

841-
def __gt__(self, other: DTypeLike) -> builtins.bool: ...
842-
def __ge__(self, other: DTypeLike) -> builtins.bool: ...
843-
def __lt__(self, other: DTypeLike) -> builtins.bool: ...
844-
def __le__(self, other: DTypeLike) -> builtins.bool: ...
841+
def __gt__(self, other: DTypeLike, /) -> builtins.bool: ...
842+
def __ge__(self, other: DTypeLike, /) -> builtins.bool: ...
843+
def __lt__(self, other: DTypeLike, /) -> builtins.bool: ...
844+
def __le__(self, other: DTypeLike, /) -> builtins.bool: ...
845845

846846
# Explicitly defined `__eq__` and `__ne__` to get around mypy's
847847
# `strict_equality` option; even though their signatures are
848848
# identical to their `object`-based counterpart
849-
def __eq__(self, other: Any) -> builtins.bool: ...
850-
def __ne__(self, other: Any) -> builtins.bool: ...
849+
def __eq__(self, other: Any, /) -> builtins.bool: ...
850+
def __ne__(self, other: Any, /) -> builtins.bool: ...
851851

852852
@property
853853
def alignment(self) -> int: ...

0 commit comments

Comments
 (0)