From 76c125db7ebcdcdc0a81c4e9c92edec5291e8807 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 23 Sep 2025 20:47:59 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20`=5Fnumtype.AnyRank`=20and=20ra?= =?UTF-8?q?nk-type=20rework?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/_numtype/__init__.pyi | 1 + src/_numtype/_rank.pyi | 97 ++++++++++----------------------------- 2 files changed, 26 insertions(+), 72 deletions(-) diff --git a/src/_numtype/__init__.pyi b/src/_numtype/__init__.pyi index 0f23e443..007260aa 100644 --- a/src/_numtype/__init__.pyi +++ b/src/_numtype/__init__.pyi @@ -84,6 +84,7 @@ from ._nep50 import ( CastsWithScalar as CastsWithScalar, ) from ._rank import ( + AnyRank as AnyRank, HasInnerShape as HasInnerShape, HasRankGE as HasRankGE, HasRankLE as HasRankLE, diff --git a/src/_numtype/_rank.pyi b/src/_numtype/_rank.pyi index a9b74db8..3687cb92 100644 --- a/src/_numtype/_rank.pyi +++ b/src/_numtype/_rank.pyi @@ -1,9 +1,10 @@ from typing import Any, Generic, Protocol, Self, TypeAlias, final, type_check_only -from typing_extensions import TypeAliasType, TypeVar, TypeVarTuple, override +from typing_extensions import TypeAliasType, TypeVar, TypeVarTuple from ._shape import AnyShape, Shape, Shape0, Shape1, Shape1N, Shape2, Shape2N, Shape3, Shape3N, Shape4, Shape4N __all__ = [ + "AnyRank", "HasInnerShape", "HasRankGE", "HasRankLE", @@ -22,11 +23,6 @@ __all__ = [ ### -_Shape01: TypeAlias = Shape0 | Shape1 -_Shape02: TypeAlias = _Shape01 | Shape2 -_Shape03: TypeAlias = _Shape02 | Shape3 -_Shape04: TypeAlias = _Shape03 | Shape4 - ### # TODO(jorenham): remove `| Rank0 | Rank` once python/mypy#19110 is fixed @@ -42,15 +38,12 @@ _RankGE: TypeAlias = _CanBroadcast[_LowerT, Any, _RankT] | _LowerT | Rank HasRankLE = TypeAliasType("HasRankLE", _HasInnerShape[_RankLE[_UpperT, _RankT]], type_params=(_UpperT, _RankT)) HasRankGE = TypeAliasType("HasRankGE", _HasInnerShape[_RankGE[_LowerT, _RankT]], type_params=(_LowerT, _RankT)) -_ShapeT = TypeVar("_ShapeT", bound=Shape) - # for unwrapping potential rank types as shape tuples +_ShapeT = TypeVar("_ShapeT", bound=Shape) HasInnerShape = TypeAliasType("HasInnerShape", _HasInnerShape[_HasOwnShape[Any, _ShapeT]], type_params=(_ShapeT,)) ### -_ShapeLikeT_co = TypeVar("_ShapeLikeT_co", bound=Shape | _HasOwnShape | _CanBroadcast[Any, Any], covariant=True) - _FromT_contra = TypeVar("_FromT_contra", contravariant=True) _ToT_contra = TypeVar("_ToT_contra", bound=tuple[Any, ...], contravariant=True) _EquivT_co = TypeVar("_EquivT_co", bound=Shape, default=Any, covariant=True) @@ -61,6 +54,8 @@ _EquivT_co = TypeVar("_EquivT_co", bound=Shape, default=Any, covariant=True) class _CanBroadcast(Protocol[_FromT_contra, _ToT_contra, _EquivT_co]): def __broadcast__(self, from_: _FromT_contra, to: _ToT_contra, /) -> _EquivT_co: ... +_ShapeLikeT_co = TypeVar("_ShapeLikeT_co", bound=Shape | _HasOwnShape | _CanBroadcast[Any, Any], covariant=True) + # __inner_shape__ is similar to `shape`, but directly exposes the `Rank` type. @final @type_check_only @@ -85,72 +80,30 @@ class _HasOwnShape(Protocol[_OwnShapeT_contra, _OwnShapeT_co]): _Ts = TypeVarTuple("_Ts") # should only contain `int`s -# https://github.com/python/mypy/issues/19093 -@type_check_only -class BaseRank(tuple[*_Ts], Generic[*_Ts]): - def __broadcast__(self, from_: tuple[*_Ts], to: tuple[*_Ts], /) -> Self: ... - def __own_shape__(self, shape: tuple[*_Ts], /) -> tuple[*_Ts]: ... - -@final -@type_check_only -class Rank0(BaseRank[()]): - @override - def __broadcast__(self, from_: Shape0 | _HasOwnShape[Shape, Any], to: Shape, /) -> Self: ... - -@final -@type_check_only -class Rank1(BaseRank[int]): - @override - def __broadcast__(self, from_: _Shape01 | _HasOwnShape[Shape1N, Any], to: Shape1N, /) -> Self: ... - -@final -@type_check_only -class Rank2(BaseRank[int, int]): - @override - def __broadcast__(self, from_: _Shape02 | _HasOwnShape[Shape2N, Any], to: Shape2N, /) -> Self: ... - -@final -@type_check_only -class Rank3(BaseRank[int, int, int]): - @override - def __broadcast__(self, from_: _Shape03 | _HasOwnShape[Shape3N, Any], to: Shape3N, /) -> Self: ... - @final @type_check_only -class Rank4(BaseRank[int, int, int, int]): - @override - def __broadcast__(self, from_: _Shape04 | _HasOwnShape[Shape4N, Any], to: Shape4N, /) -> Self: ... - -# these emulates `AnyOf` (gradual union), rather than a `Union`. - -@final -@type_check_only -class Rank(BaseRank[*tuple[int, ...]]): - @override - def __broadcast__(self, from_: AnyShape, to: tuple[*_Ts], /) -> Self: ... +class BaseRank(tuple[*_Ts], Generic[_FromT_contra, _ToT_contra, *_Ts]): + def __broadcast__(self, from_: _FromT_contra, to: _ToT_contra, /) -> Self: ... + def __own_shape__(self, shape: tuple[*_Ts], /) -> tuple[*_Ts]: ... -@final -@type_check_only -class Rank1N(BaseRank[int, *tuple[int, ...]]): - @override - def __broadcast__(self, from_: AnyShape, to: Shape1N, /) -> Self: ... +_Shape01: TypeAlias = Shape0 | Shape1 +_Shape02: TypeAlias = _Shape01 | Shape2 +_Shape03: TypeAlias = _Shape02 | Shape3 +_Shape04: TypeAlias = _Shape03 | Shape4 -@final -@type_check_only -class Rank2N(BaseRank[int, int, *tuple[int, ...]]): - @override - def __broadcast__(self, from_: AnyShape, to: Shape2N, /) -> Self: ... +Rank0 = TypeAliasType("Rank0", BaseRank[Shape0 | _HasOwnShape[Shape, Any], Shape, *tuple[()]]) +Rank1 = TypeAliasType("Rank1", BaseRank[_Shape01 | _HasOwnShape[Shape1N, Any], Shape1N, int]) +Rank2 = TypeAliasType("Rank2", BaseRank[_Shape02 | _HasOwnShape[Shape2N, Any], Shape2N, int, int]) +Rank3 = TypeAliasType("Rank3", BaseRank[_Shape03 | _HasOwnShape[Shape3N, Any], Shape3N, int, int, int]) +Rank4 = TypeAliasType("Rank4", BaseRank[_Shape04 | _HasOwnShape[Shape4N, Any], Shape4N, int, int, int, int]) -@final -@type_check_only -class Rank3N(BaseRank[int, int, int, *tuple[int, ...]]): - @override - def __broadcast__(self, from_: AnyShape, to: Shape3N, /) -> Self: ... +Rank = TypeAliasType("Rank", BaseRank[Shape, Shape, *tuple[int, ...]]) +AnyRank = TypeAliasType("AnyRank", BaseRank[Any, AnyShape, *tuple[Any, ...]]) -@final -@type_check_only -class Rank4N(BaseRank[int, int, int, int, *tuple[int, ...]]): - @override - def __broadcast__(self, from_: AnyShape, to: Shape4N, /) -> Self: ... +Rank0N = Rank +Rank1N = TypeAliasType("Rank1N", BaseRank[AnyShape, Shape1N, int, *tuple[int, ...]]) +Rank2N = TypeAliasType("Rank2N", BaseRank[AnyShape, Shape2N, int, int, *tuple[int, ...]]) +Rank3N = TypeAliasType("Rank3N", BaseRank[AnyShape, Shape3N, int, int, int, *tuple[int, ...]]) +Rank4N = TypeAliasType("Rank4N", BaseRank[AnyShape, Shape4N, int, int, int, int, *tuple[int, ...]]) -Rank0N: TypeAlias = Rank +# these emulate `AnyOf` (gradual union), rather than a `Union`. From 7a43d0529a0d077e7a1bccd22a09efd2e8475796 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 23 Sep 2025 20:48:31 +0200 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=B4=20remove=20rank=20testgen=20my?= =?UTF-8?q?py=20workaround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/_numtype/@test/generated/test_rank.pyi | 4 ++-- tool/testgen.py | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/_numtype/@test/generated/test_rank.pyi b/src/_numtype/@test/generated/test_rank.pyi index 902c52cc..f0fcfa35 100644 --- a/src/_numtype/@test/generated/test_rank.pyi +++ b/src/_numtype/@test/generated/test_rank.pyi @@ -1,4 +1,4 @@ -# @generated 2025-05-19T03:25:34Z with tool/testgen.py +# @generated 2025-09-23T18:34:13Z with tool/testgen.py from typing import Any import _numtype as _nt @@ -31,7 +31,7 @@ r0n_le_r0n: _nt.HasRankLE[_nt.Rank0N] = r0n r0_ge_s0: _nt.HasRankGE[_nt.Shape0] = r0 r0_ge_r0: _nt.HasRankGE[_nt.Rank0] = r0 -r0_ge_s0n: _nt.HasRankGE[_nt.Shape0N] = r0 # type: ignore[assignment] +r0_ge_s0n: _nt.HasRankGE[_nt.Shape0N] = r0 r0_ge_r0n: _nt.HasRankGE[_nt.Rank0N] = r0 r0n_ge_s0: _nt.HasRankGE[_nt.Shape0] = r0n r0n_ge_r0: _nt.HasRankGE[_nt.Rank0] = r0n diff --git a/tool/testgen.py b/tool/testgen.py index 989b6ec5..031a77a2 100644 --- a/tool/testgen.py +++ b/tool/testgen.py @@ -1618,16 +1618,6 @@ def get_testcases(self) -> Iterable[str | None]: expr_type = f"{name_type_orig}[{_NT}.{name_type_arg}]" expr_template = templates[accept] - - # TODO(jorenham): remove once python/mypy#19110 is fixed - if ( - n_lhs == n_rhs == 0 - and name_op == "ge" - and name_lhs[0] == "s" - and name_lhs[-1] == "n" - ): - expr_template = f"{expr_template} # type: ignore[assignment]" - yield expr_template.format(name_test, expr_type, name_rhs) for name_lhs, name_type_arg in [ From 61efe9196ac50820b8a7f85f68a10f50c011ccd6 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 23 Sep 2025 20:49:01 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=85=20simple=20type-tests=20for=20`An?= =?UTF-8?q?yRank`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/_numtype/@test/test_rank_shape.pyi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/_numtype/@test/test_rank_shape.pyi b/src/_numtype/@test/test_rank_shape.pyi index 59cd14b7..0fe61150 100644 --- a/src/_numtype/@test/test_rank_shape.pyi +++ b/src/_numtype/@test/test_rank_shape.pyi @@ -23,3 +23,25 @@ assert_type(a3.shape, _nt.Shape3) # type: ignore[assert-type] a4: _nt.Array4D assert_type(a4.__inner_shape__, _nt.Rank4) assert_type(a4.shape, _nt.Shape4) # type: ignore[assert-type] + +### + +rx: _nt.AnyRank +r0: _nt.Rank0 +r1: _nt.Rank1 +r2: _nt.Rank2 +r3: _nt.Rank3 +r4: _nt.Rank4 + +rx0: _nt.AnyRank = r0 +rx1: _nt.AnyRank = r1 +rx2: _nt.AnyRank = r2 +rx3: _nt.AnyRank = r3 +rx4: _nt.AnyRank = r4 + +# TODO: remove the `# type ignore`s once python/mypy#19908 is fixed (yes, another one) + +r0x: _nt.Rank0 = rx # type: ignore[assignment] +r1x: _nt.Rank1 = rx # type: ignore[assignment] +r2x: _nt.Rank2 = rx # type: ignore[assignment] +r3x: _nt.Rank3 = rx # type: ignore[assignment] From 745da3dcd4a052ab0c48bf2544651e8cd5c4ace2 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 23 Sep 2025 20:49:36 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=90=B4=20remove=20unused=20false-posi?= =?UTF-8?q?tive=20`#=20type:=20ignore`s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../@test/static/accept/fromnumeric.pyi | 3 +-- src/numpy-stubs/__init__.pyi | 2 +- src/numpy-stubs/_core/_multiarray_umath.pyi | 8 +++---- src/numpy-stubs/_core/numeric.pyi | 24 +++++++++---------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/numpy-stubs/@test/static/accept/fromnumeric.pyi b/src/numpy-stubs/@test/static/accept/fromnumeric.pyi index a744a13b..e0801cae 100644 --- a/src/numpy-stubs/@test/static/accept/fromnumeric.pyi +++ b/src/numpy-stubs/@test/static/accept/fromnumeric.pyi @@ -144,8 +144,7 @@ assert_type(np.nonzero(AR_f4), tuple[_nt.Array[np.intp], ...]) assert_type(np.nonzero(AR_1d), tuple[_nt.Array[np.intp], ...]) assert_type(np.nonzero(AR_nd), tuple[_nt.Array[np.intp], ...]) -# TODO: remove the `# type: ignore` once python/mypy#19110 is fixed -assert_type(np.shape(b1), tuple[()]) # type: ignore[assert-type] +assert_type(np.shape(b1), tuple[()]) assert_type(np.shape(f_0d), tuple[()]) assert_type(np.shape(i_1d), tuple[int]) assert_type(np.shape(i_2d), tuple[int, int]) diff --git a/src/numpy-stubs/__init__.pyi b/src/numpy-stubs/__init__.pyi index 5c6b8d01..aace0757 100644 --- a/src/numpy-stubs/__init__.pyi +++ b/src/numpy-stubs/__init__.pyi @@ -2711,7 +2711,7 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeT_co, _DTypeT_co]): # @override @overload # workaround for python/mypy#19110 - def tolist(self: _HasShapeAndItem[_nt.Rank0, _T], /) -> _T: ... # type: ignore[overload-overlap] + def tolist(self: _HasShapeAndItem[_nt.Rank0, _T], /) -> _T: ... @overload # workaround for microsoft/pyright#10232 def tolist(self: ndarray[_nt.NeitherShape], /) -> Any: ... @overload diff --git a/src/numpy-stubs/_core/_multiarray_umath.pyi b/src/numpy-stubs/_core/_multiarray_umath.pyi index 18815453..133058df 100644 --- a/src/numpy-stubs/_core/_multiarray_umath.pyi +++ b/src/numpy-stubs/_core/_multiarray_umath.pyi @@ -641,7 +641,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array[np.bool_]: ... @overload # bool 0d array-like -def empty_like( # type: ignore[overload-overlap] +def empty_like( prototype: _nt.ToBool_0d, dtype: _nt.ToDTypeBool | None = None, order: _OrderKACF = "K", @@ -691,7 +691,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array[np.intp]: ... @overload # int 0d array-like -def empty_like( # type: ignore[overload-overlap] +def empty_like( prototype: _nt.ToInt_0d, dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -741,7 +741,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array[np.float64]: ... @overload # float 0d array-like -def empty_like( # type: ignore[overload-overlap] +def empty_like( prototype: _nt.ToFloat64_0d, dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", @@ -781,7 +781,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array3D[np.float64]: ... @overload # complex 0d array-like -def empty_like( # type: ignore[overload-overlap] +def empty_like( prototype: _nt.ToComplex128_0d, dtype: _nt.ToDTypeComplex128 | None = None, order: _OrderKACF = "K", diff --git a/src/numpy-stubs/_core/numeric.pyi b/src/numpy-stubs/_core/numeric.pyi index b6f24179..0e28df8e 100644 --- a/src/numpy-stubs/_core/numeric.pyi +++ b/src/numpy-stubs/_core/numeric.pyi @@ -1042,7 +1042,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array[np.bool_]: ... @overload # bool 0d array-like -def zeros_like( # type: ignore[overload-overlap] +def zeros_like( a: _nt.ToBool_0d, dtype: _nt.ToDTypeBool | None = None, order: _OrderKACF = "K", @@ -1092,7 +1092,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array[np.intp]: ... @overload # int 0d array-like -def zeros_like( # type: ignore[overload-overlap] +def zeros_like( a: _nt.ToInt_0d, dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -1142,7 +1142,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array[np.float64]: ... @overload # float 0d array-like -def zeros_like( # type: ignore[overload-overlap] +def zeros_like( a: _nt.ToFloat64_0d, dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", @@ -1192,7 +1192,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array[np.complex128]: ... @overload # complex 0d array-like -def zeros_like( # type: ignore[overload-overlap] +def zeros_like( a: _nt.ToComplex128_0d, dtype: _nt.ToDTypeComplex128 | None = None, order: _OrderKACF = "K", @@ -1384,7 +1384,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array[np.bool_]: ... @overload # bool 0d array-like -def ones_like( # type: ignore[overload-overlap] +def ones_like( a: _nt.ToBool_0d, dtype: _nt.ToDTypeBool | None = None, order: _OrderKACF = "K", @@ -1434,7 +1434,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array[np.intp]: ... @overload # int 0d array-like -def ones_like( # type: ignore[overload-overlap] +def ones_like( a: _nt.ToInt_0d, dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -1484,7 +1484,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array[np.float64]: ... @overload # float 0d array-like -def ones_like( # type: ignore[overload-overlap] +def ones_like( a: _nt.ToFloat64_0d, dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", @@ -1534,7 +1534,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array[np.complex128]: ... @overload # complex 0d array-like -def ones_like( # type: ignore[overload-overlap] +def ones_like( a: _nt.ToComplex128_0d, dtype: _nt.ToDTypeComplex128 | None = None, order: _OrderKACF = "K", @@ -1718,7 +1718,7 @@ def full_like( device: _Device | None = None, ) -> np.ndarray[_ShapeT, _DTypeT]: ... @overload # bool 0d array-like -def full_like( # type: ignore[overload-overlap] +def full_like( a: _nt.ToBool_0d, fill_value: object, dtype: _nt.ToDTypeBool | None = None, @@ -1762,7 +1762,7 @@ def full_like( device: _Device | None = None, ) -> _nt.Array3D[np.bool_]: ... @overload # int 0d array-like -def full_like( # type: ignore[overload-overlap] +def full_like( a: _nt.ToInt_0d, fill_value: object, dtype: _nt.ToDTypeInt64 | None = None, @@ -1806,7 +1806,7 @@ def full_like( device: _Device | None = None, ) -> _nt.Array3D[np.intp]: ... @overload # float 0d array-like -def full_like( # type: ignore[overload-overlap] +def full_like( a: _nt.ToFloat64_0d, fill_value: object, dtype: _nt.ToDTypeFloat64 | None = None, @@ -1850,7 +1850,7 @@ def full_like( device: _Device | None = None, ) -> _nt.Array3D[np.float64]: ... @overload # complex 0d array-like -def full_like( # type: ignore[overload-overlap] +def full_like( a: _nt.ToComplex128_0d, fill_value: object, dtype: _nt.ToDTypeComplex128 | None = None, From e751f43ad557bdd721969e1ef1caffd4c400027c Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 23 Sep 2025 21:07:29 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=B4=20work=20around=20a=20bunch=20?= =?UTF-8?q?of=20new=20`overload-overlap`=20false=20positives?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/numpy-stubs/_core/_multiarray_umath.pyi | 4 +- src/numpy-stubs/_core/fromnumeric.pyi | 2 - src/numpy-stubs/_core/numeric.pyi | 12 +-- src/numpy-stubs/lib/_function_base_impl.pyi | 2 +- src/numpy-stubs/polynomial/_polybase.pyi | 2 +- src/numpy-stubs/random/_generator.pyi | 100 ++++++++++---------- 6 files changed, 60 insertions(+), 62 deletions(-) diff --git a/src/numpy-stubs/_core/_multiarray_umath.pyi b/src/numpy-stubs/_core/_multiarray_umath.pyi index 133058df..03e8cad9 100644 --- a/src/numpy-stubs/_core/_multiarray_umath.pyi +++ b/src/numpy-stubs/_core/_multiarray_umath.pyi @@ -681,7 +681,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array3D[np.bool_]: ... @overload # workaround for microsoft/pyright#10232 -def empty_like( +def empty_like( # type: ignore[overload-overlap] # python/mypy#19908 prototype: _nt._ToArray_nnd[np.intp], dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -731,7 +731,7 @@ def empty_like( device: _Device | None = None, ) -> _nt.Array3D[np.intp]: ... @overload # workaround for microsoft/pyright#10232 -def empty_like( +def empty_like( # type: ignore[overload-overlap] # python/mypy#19908 prototype: _nt._ToArray_nnd[np.float64], dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", diff --git a/src/numpy-stubs/_core/fromnumeric.pyi b/src/numpy-stubs/_core/fromnumeric.pyi index b4bc99ca..bb537d90 100644 --- a/src/numpy-stubs/_core/fromnumeric.pyi +++ b/src/numpy-stubs/_core/fromnumeric.pyi @@ -422,8 +422,6 @@ def squeeze(a: _ScalarT, axis: _ShapeLike | None = None) -> _nt.Array0D[_ScalarT @overload # workaround for microsoft/pyright#10232 def squeeze(a: _nt._ToArray_nnd[_ScalarT], axis: _ShapeLike | None = None) -> _nt.Array[_ScalarT]: ... @overload -def squeeze(a: _nt.CanArray0D[_ScalarT], axis: _ShapeLike | None = None) -> _nt.Array0D[_ScalarT]: ... -@overload def squeeze(a: _nt._ToArray_nd[_ScalarT], axis: _ShapeLike | None = None) -> _nt.Array[_ScalarT]: ... @overload def squeeze(a: ArrayLike, axis: _ShapeLike | None = None) -> _nt.Array[Incomplete]: ... diff --git a/src/numpy-stubs/_core/numeric.pyi b/src/numpy-stubs/_core/numeric.pyi index 0e28df8e..e899bc4e 100644 --- a/src/numpy-stubs/_core/numeric.pyi +++ b/src/numpy-stubs/_core/numeric.pyi @@ -1082,7 +1082,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array3D[np.bool_]: ... @overload # workaround for microsoft/pyright#10232 -def zeros_like( +def zeros_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.intp], dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -1132,7 +1132,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array3D[np.intp]: ... @overload # workaround for microsoft/pyright#10232 -def zeros_like( +def zeros_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.float64], dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", @@ -1182,7 +1182,7 @@ def zeros_like( device: _Device | None = None, ) -> _nt.Array3D[np.float64]: ... @overload # workaround for microsoft/pyright#10232 -def zeros_like( +def zeros_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.complex128], dtype: _nt.ToDTypeComplex128 | None = None, order: _OrderKACF = "K", @@ -1424,7 +1424,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array3D[np.bool_]: ... @overload # workaround for microsoft/pyright#10232 -def ones_like( +def ones_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.intp], dtype: _nt.ToDTypeInt64 | None = None, order: _OrderKACF = "K", @@ -1474,7 +1474,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array3D[np.intp]: ... @overload # workaround for microsoft/pyright#10232 -def ones_like( +def ones_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.float64], dtype: _nt.ToDTypeFloat64 | None = None, order: _OrderKACF = "K", @@ -1524,7 +1524,7 @@ def ones_like( device: _Device | None = None, ) -> _nt.Array3D[np.float64]: ... @overload # workaround for microsoft/pyright#10232 -def ones_like( +def ones_like( # type: ignore[overload-overlap] # python/mypy#19908 a: _nt._ToArray_nnd[np.complex128], dtype: _nt.ToDTypeComplex128 | None = None, order: _OrderKACF = "K", diff --git a/src/numpy-stubs/lib/_function_base_impl.pyi b/src/numpy-stubs/lib/_function_base_impl.pyi index cfd15f21..3ec51c09 100644 --- a/src/numpy-stubs/lib/_function_base_impl.pyi +++ b/src/numpy-stubs/lib/_function_base_impl.pyi @@ -1193,7 +1193,7 @@ def append(arr: ArrayLike, values: ArrayLike, axis: CanIndex | None = ...) -> _n # @overload # workaround for microsoft/pyright#10232 -def digitize(x: _nt._ToArray_nnd[_nt.co_float], bins: _nt.CoFloating_1d, right: bool = False) -> _nt.Array[np.intp]: ... +def digitize(x: _nt._ToArray_nnd[_nt.co_float], bins: _nt.CoFloating_1d, right: bool = False) -> _nt.Array[np.intp]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload def digitize(x: _nt.CoFloating_0d, bins: _nt.CoFloating_1d, right: bool = False) -> np.intp: ... @overload diff --git a/src/numpy-stubs/polynomial/_polybase.pyi b/src/numpy-stubs/polynomial/_polybase.pyi index ce728fce..8f2961c5 100644 --- a/src/numpy-stubs/polynomial/_polybase.pyi +++ b/src/numpy-stubs/polynomial/_polybase.pyi @@ -61,7 +61,7 @@ class ABCPolyBase(abc.ABC): @overload def __call__(self, /, arg: _PolyT) -> _PolyT: ... @overload # workaround for microsoft/pyright#10232 - def __call__(self, /, arg: _nt._ToArray_nnd[_nt.co_complex]) -> _nt.Array[_nt.inexact64]: ... + def __call__(self, /, arg: _nt._ToArray_nnd[_nt.co_complex]) -> _nt.Array[_nt.inexact64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload def __call__(self, /, arg: _nt.CoComplex_0d) -> _nt.inexact64: ... @overload diff --git a/src/numpy-stubs/random/_generator.pyi b/src/numpy-stubs/random/_generator.pyi index 4023b44c..81d4df5f 100644 --- a/src/numpy-stubs/random/_generator.pyi +++ b/src/numpy-stubs/random/_generator.pyi @@ -159,15 +159,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def uniform( + def uniform( # type: ignore[overload-overlap] # python/mypy#19908 self, /, low: _CoFloat_nnd, high: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def uniform( + def uniform( # type: ignore[overload-overlap] # python/mypy#19908 self, /, low: _nt.CoFloating_nd, high: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def uniform( + def uniform( # type: ignore[overload-overlap] # python/mypy#19908 self, /, low: _nt.CoFloating_nd = 0.0, *, high: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -187,15 +187,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def triangular( + def triangular( # type: ignore[overload-overlap] # python/mypy#19908 self, /, left: _CoFloat_nnd, mode: _nt.CoFloating_nd, right: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def triangular( + def triangular( # type: ignore[overload-overlap] # python/mypy#19908 self, /, left: _nt.CoFloating_nd, mode: _CoFloat_nnd, right: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def triangular( + def triangular( # type: ignore[overload-overlap] # python/mypy#19908 self, /, left: _nt.CoFloating_nd, mode: _nt.CoFloating_nd, right: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -218,9 +218,9 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def beta(self, /, a: _CoFloat_nnd, b: _nt.CoFloating_nd, size: None = None) -> float | _nt.Array[np.float64]: ... + def beta(self, /, a: _CoFloat_nnd, b: _nt.CoFloating_nd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # workaround for microsoft/pyright#10232 - def beta(self, /, a: _nt.CoFloating_nd, b: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def beta(self, /, a: _nt.CoFloating_nd, b: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def beta(self, /, a: _nt.CoFloating_0d, b: _nt.CoFloating_0d, size: None = None) -> float: ... @overload # size: (int, ...) @@ -276,7 +276,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def exponential(self, /, scale: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def exponential(self, /, scale: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload def exponential(self, /, scale: _nt.CoFloating_0d = 1.0, size: None = None) -> float: ... @overload @@ -290,15 +290,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def laplace( + def laplace( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _CoFloat_nnd, scale: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def laplace( + def laplace( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def laplace( + def laplace( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd = 0.0, *, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -318,15 +318,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def logistic( + def logistic( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _CoFloat_nnd, scale: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def logistic( + def logistic( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def logistic( + def logistic( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd = 0.0, *, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -346,7 +346,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def power(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def power(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def power(self, /, a: _nt.CoFloating_0d, size: None = None) -> float: ... @overload # size: (int, ...) @@ -356,7 +356,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def pareto(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def pareto(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def pareto(self, /, a: _nt.CoFloating_0d, size: None = None) -> float: ... @overload # size: (int, ...) @@ -366,15 +366,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def gumbel( + def gumbel( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _CoFloat_nnd, scale: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def gumbel( + def gumbel( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def gumbel( + def gumbel( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd = 0.0, *, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -394,7 +394,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def weibull(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def weibull(self, /, a: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def weibull(self, /, a: _nt.CoFloating_0d, size: None = None) -> float: ... @overload # size: (int, ...) @@ -404,7 +404,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def rayleigh(self, /, scale: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def rayleigh(self, /, scale: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def rayleigh(self, /, scale: _nt.CoFloating_0d = 1.0, size: None = None) -> float: ... @overload # size: (int, ...) (positional) @@ -418,7 +418,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def chisquare(self, /, df: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... + def chisquare(self, /, df: _CoFloat_nnd, size: None = None) -> float | _nt.Array[np.float64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def chisquare(self, /, df: _nt.CoFloating_0d, size: None = None) -> float: ... @overload # size: (int, ...) @@ -428,11 +428,11 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def noncentral_chisquare( + def noncentral_chisquare( # type: ignore[overload-overlap] # python/mypy#19908 self, /, df: _CoFloat_nnd, nonc: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def noncentral_chisquare( + def noncentral_chisquare( # type: ignore[overload-overlap] # python/mypy#19908 self, /, df: _nt.CoFloating_nd, nonc: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -468,15 +468,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def normal( + def normal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _CoFloat_nnd, scale: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def normal( + def normal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def normal( + def normal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, loc: _nt.CoFloating_nd = 0.0, *, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -496,15 +496,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def lognormal( + def lognormal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, mean: _CoFloat_nnd, sigma: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def lognormal( + def lognormal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, mean: _nt.CoFloating_nd = 0.0, *, sigma: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def lognormal( + def lognormal( # type: ignore[overload-overlap] # python/mypy#19908 self, /, mean: _nt.CoFloating_nd, sigma: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -526,11 +526,11 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def vonmises( + def vonmises( # type: ignore[overload-overlap] # python/mypy#19908 self, /, mu: _CoFloat_nnd, kappa: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def vonmises( + def vonmises( # type: ignore[overload-overlap] # python/mypy#19908 self, /, mu: _nt.CoFloating_nd, kappa: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -562,15 +562,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def standard_gamma( + def standard_gamma( # type: ignore[overload-overlap] # python/mypy#19908 self, /, shape: _CoFloat_nnd, size: None = None, dtype: _nt.ToDTypeFloat64 = ..., out: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def standard_gamma( + def standard_gamma( # type: ignore[overload-overlap] # python/mypy#19908 self, /, shape: _CoFloat_nnd, size: None = None, *, dtype: _nt.ToDTypeFloat32, out: None = None ) -> float | _nt.Array[np.float32]: ... @overload # workaround for microsoft/pyright#10232 - def standard_gamma( + def standard_gamma( # type: ignore[overload-overlap] # python/mypy#19908 self, /, shape: _CoFloat_nnd, size: None, dtype: _nt.ToDTypeFloat32, out: None = None ) -> float | _nt.Array[np.float32]: ... @overload @@ -637,11 +637,11 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def gamma( + def gamma( # type: ignore[overload-overlap] # python/mypy#19908 self, /, shape: _CoFloat_nnd, scale: _nt.CoFloating_nd = 1.0, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def gamma( + def gamma( # type: ignore[overload-overlap] # python/mypy#19908 self, /, shape: _nt.CoFloating_nd, scale: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -661,11 +661,11 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def f( + def f( # type: ignore[overload-overlap] # python/mypy#19908 self, /, dfnum: _CoFloat_nnd, dfden: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def f( + def f( # type: ignore[overload-overlap] # python/mypy#19908 self, /, dfnum: _nt.CoFloating_nd, dfden: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -679,15 +679,15 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def noncentral_f( + def noncentral_f( # type: ignore[overload-overlap] # python/mypy#19908 self, /, dfnum: _CoFloat_nnd, dfden: _nt.CoFloating_nd, nonc: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def noncentral_f( + def noncentral_f( # type: ignore[overload-overlap] # python/mypy#19908 self, /, dfnum: _nt.CoFloating_nd, dfden: _CoFloat_nnd, nonc: _nt.CoFloating_nd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # workaround for microsoft/pyright#10232 - def noncentral_f( + def noncentral_f( # type: ignore[overload-overlap] # python/mypy#19908 self, /, dfnum: _nt.CoFloating_nd, dfden: _nt.CoFloating_nd, nonc: _CoFloat_nnd, size: None = None ) -> float | _nt.Array[np.float64]: ... @overload # size: None (default) @@ -1197,7 +1197,7 @@ class Generator: @overload # workaround for microsoft/pyright#10232 def binomial(self, /, n: _CoInt_nnd, p: _nt.CoFloating_nd, size: None = None) -> int | _nt.Array[np.int64]: ... @overload # workaround for microsoft/pyright#10232 - def binomial(self, /, n: _nt.CoInteger_nd, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... + def binomial(self, /, n: _nt.CoInteger_nd, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def binomial(self, /, n: int, p: _nt.CoFloating_0d, size: None = None) -> int: ... @overload # size: (int, ...) @@ -1209,11 +1209,11 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def negative_binomial( + def negative_binomial( # type: ignore[overload-overlap] # python/mypy#19908 self, /, n: _CoFloat_nnd, p: _nt.CoFloating_nd, size: None = None ) -> int | _nt.Array[np.int64]: ... @overload # workaround for microsoft/pyright#10232 - def negative_binomial( + def negative_binomial( # type: ignore[overload-overlap] # python/mypy#19908 self, /, n: _nt.CoFloating_nd, p: _CoFloat_nnd, size: None = None ) -> int | _nt.Array[np.int64]: ... @overload # size: None (default) @@ -1229,7 +1229,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def poisson(self, /, lam: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... + def poisson(self, /, lam: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def poisson(self, /, lam: _nt.CoFloating_0d = 1.0, size: None = None) -> int: ... @overload # size: (int, ...) (positional) @@ -1241,7 +1241,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def zipf(self, /, a: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... + def zipf(self, /, a: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def zipf(self, /, a: _nt.CoFloating_0d, size: None = None) -> int: ... @overload # size: (int, ...) @@ -1251,7 +1251,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def geometric(self, /, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... + def geometric(self, /, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def geometric(self, /, p: _nt.CoFloating_0d, size: None = None) -> int: ... @overload # size: (int, ...) @@ -1290,7 +1290,7 @@ class Generator: # @overload # workaround for microsoft/pyright#10232 - def logseries(self, /, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... + def logseries(self, /, p: _CoFloat_nnd, size: None = None) -> int | _nt.Array[np.int64]: ... # type: ignore[overload-overlap] # python/mypy#19908 @overload # size: None (default) def logseries(self, /, p: _nt.CoFloating_0d, size: None = None) -> int: ... @overload # size: (int, ...)