Skip to content

Commit 7c47019

Browse files
authored
🩹 minor fixes for some internal cython module stubs (#878)
2 parents 7c18175 + 3da9cb6 commit 7c47019

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

‎scipy-stubs/io/matlab/_mio5_utils.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ _bint: TypeAlias = Literal[0, 1] | bool # noqa: PYI042
1616
###
1717

1818
# NOTE: These apprear to be broken, and will always raise `TypeError: no default __reduce__ due to non-trivial __cinit__`
19-
def __reduce_cython__(self: Never) -> Never: ... # undocumented
20-
def __setstate_cython__(self: Never, __pyx_state: Never) -> None: ... # undocumented # pyright: ignore[reportGeneralTypeIssues]
19+
def __reduce_cython__(self: Never, /) -> Never: ... # undocumented
20+
def __setstate_cython__(self: Never, pyx_state: Never, /) -> None: ... # undocumented
2121

2222
swapped_code: Final[Literal[">", "<"]] = ... # undocumented # ">" sys.byteorder == "little" else "<"
2323

‎scipy-stubs/stats/_biasedurn.pyi‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# see `scipy/stats/_biasedurn.pyx`
22

3-
from typing import type_check_only
3+
from typing import Never, Self, type_check_only
44

55
import numpy as np
66
import optype as op
77
import optype.numpy as onp
88

99
@type_check_only
1010
class _PyNCHypergeometric:
11-
def __init__(self, /, n: op.CanInt, m: op.CanInt, N: op.CanInt, odds: op.CanFloat, accuracy: op.CanFloat) -> None: ...
11+
def __new__(cls, /, n: op.CanInt, m: op.CanInt, N: op.CanInt, odds: op.CanFloat, accuracy: op.CanFloat) -> Self: ...
1212
def mode(self, /) -> int: ...
1313
def mean(self, /) -> float: ...
1414
def variance(self, /) -> float: ...
@@ -17,9 +17,14 @@ class _PyNCHypergeometric:
1717

1818
###
1919

20-
class _PyFishersNCHypergeometric(_PyNCHypergeometric): ...
21-
class _PyWalleniusNCHypergeometric(_PyNCHypergeometric): ...
20+
# NOTE: These apprear to be broken, and will always raise `TypeError: no default __reduce__ due to non-trivial __cinit__`
21+
def __setstate_cython__(self: Never, pyx_state: Never, /) -> None: ... # undocumented
22+
def __reduce_cython__(self: Never, /) -> Never: ... # undocumented
2223

24+
class _PyFishersNCHypergeometric(_PyNCHypergeometric): ... # undocumented
25+
class _PyWalleniusNCHypergeometric(_PyNCHypergeometric): ... # undocumented
26+
27+
# undocumented
2328
class _PyStochasticLib3:
2429
def Random(self, /) -> float: ...
2530
def SetAccuracy(self, /, accur: op.CanFloat) -> None: ...
@@ -46,6 +51,3 @@ class _PyStochasticLib3:
4651
size: op.CanInt,
4752
random_state: onp.random.RNG | None = None,
4853
) -> onp.Array1D[np.float64]: ...
49-
50-
def __setstate_cython__(self: object, pyx_state: object, /) -> None: ...
51-
def __reduce_cython__(self: object) -> None: ...

0 commit comments

Comments
 (0)