Skip to content

Commit 5ee69f5

Browse files
committed
🤡 stats: work around false positive reportOverlappingOverload on numpy<2.1
1 parent 0fb2e32 commit 5ee69f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎scipy-stubs/stats/_stats_py.pyi‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -724,9 +724,9 @@ def zscore(
724724
a: Sequence[Sequence[Sequence[op.JustComplex]]], axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"
725725
) -> onp.Array3D[np.complex128]: ...
726726
@overload # floating fallback
727-
def zscore(
727+
def zscore( # the weird shape-type is a workaround for a bug in pyright's overlapping overload detection on numpy<2.1
728728
a: onp.ToFloatND, axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"
729-
) -> onp.ArrayND[npc.floating]: ...
729+
) -> onp.ArrayND[npc.floating, tuple[int] | tuple[Any, ...]]: ...
730730
@overload # complex fallback
731731
def zscore(
732732
a: onp.ToJustComplexND, axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"
@@ -770,9 +770,9 @@ def gzscore(
770770
a: Sequence[Sequence[Sequence[op.JustComplex]]], *, axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"
771771
) -> onp.Array3D[np.complex128]: ...
772772
@overload # floating fallback
773-
def gzscore(
773+
def gzscore( # the weird shape-type is a workaround for a bug in pyright's overlapping overload detection on numpy<2.1
774774
a: onp.ToFloatND, *, axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"
775-
) -> onp.ArrayND[npc.floating]: ...
775+
) -> onp.ArrayND[npc.floating, tuple[int] | tuple[Any, ...]]: ...
776776
@overload # complex fallback
777777
def gzscore(
778778
a: onp.ToJustComplexND, *, axis: int | None = 0, ddof: int = 0, nan_policy: NanPolicy = "propagate"

0 commit comments

Comments
 (0)