Skip to content

Commit 537b489

Browse files
authored
Merge pull request #259 from numpy/numpy.polynomial._polytypes
🔥 remove the type-check-only `polynomial._polytypes` module
2 parents 2b140c6 + 42ee134 commit 537b489

File tree

7 files changed

+86
-702
lines changed

7 files changed

+86
-702
lines changed

src/numpy-stubs/polynomial/_polybase.pyi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import numpy.typing as npt
88
from _numtype import Array_1d, CoComplex_0d, CoComplex_1d, CoComplex_1nd, CoInteger_0d, CoInteger_1d, ToObject_0d, ToObject_1nd
99
from numpy._typing import _FloatLike_co
1010

11-
from ._polytypes import _InexactObject_1d, _ToInt, _ToNumeric_0d, _ToNumeric_nd, _Tuple2
11+
from .polynomial import _ToNumeric_0d, _ToNumeric_nd
1212

1313
__all__: Final[Sequence[str]] = ("ABCPolyBase",)
1414

@@ -31,7 +31,7 @@ class ABCPolyBase(abc.ABC):
3131
_use_unicode: ClassVar[bool]
3232
_symbol: str
3333

34-
coef: _InexactObject_1d
34+
coef: Array_1d[np.inexact | np.object_]
3535

3636
@property
3737
def symbol(self, /) -> str: ...
@@ -81,7 +81,7 @@ class ABCPolyBase(abc.ABC):
8181
def __truediv__(self, x: _AnyOther, /) -> Self: ...
8282
def __floordiv__(self, x: _AnyOther, /) -> Self: ...
8383
def __mod__(self, x: _AnyOther, /) -> Self: ...
84-
def __divmod__(self, x: _AnyOther, /) -> _Tuple2[Self]: ...
84+
def __divmod__(self, x: _AnyOther, /) -> tuple[Self, Self]: ...
8585
def __pow__(self, x: _AnyOther, /) -> Self: ...
8686
def __radd__(self, x: _AnyOther, /) -> Self: ...
8787
def __rsub__(self, x: _AnyOther, /) -> Self: ...
@@ -90,7 +90,7 @@ class ABCPolyBase(abc.ABC):
9090
def __rfloordiv__(self, x: _AnyOther, /) -> Self: ...
9191
def __rdiv__(self, x: _AnyOther, /) -> Self: ...
9292
def __rmod__(self, x: _AnyOther, /) -> Self: ...
93-
def __rdivmod__(self, x: _AnyOther, /) -> _Tuple2[Self]: ...
93+
def __rdivmod__(self, x: _AnyOther, /) -> tuple[Self, Self]: ...
9494
def __len__(self, /) -> int: ...
9595
def __iter__(self, /) -> Iterator[np.inexact | object]: ...
9696
def __getstate__(self, /) -> dict[str, Any]: ...
@@ -107,7 +107,7 @@ class ABCPolyBase(abc.ABC):
107107
def degree(self, /) -> int: ...
108108
def cutdeg(self, /, deg: int) -> Self: ...
109109
def trim(self, /, tol: _FloatLike_co = 0) -> Self: ...
110-
def truncate(self, /, size: _ToInt) -> Self: ...
110+
def truncate(self, /, size: SupportsIndex) -> Self: ...
111111

112112
#
113113
@overload
@@ -125,16 +125,16 @@ class ABCPolyBase(abc.ABC):
125125
) -> _PolyT: ...
126126

127127
#
128-
def mapparms(self, /) -> _Tuple2[Any]: ...
128+
def mapparms(self, /) -> tuple[Any, Any]: ...
129129
def integ(self, /, m: SupportsIndex = 1, k: _ToNumeric_0d | CoComplex_1d = [], lbnd: _ToNumeric_0d | None = None) -> Self: ...
130130
def deriv(self, /, m: SupportsIndex = 1) -> Self: ...
131-
def roots(self, /) -> _InexactObject_1d: ...
131+
def roots(self, /) -> Array_1d[np.float64] | Array_1d[np.complex128]: ...
132132
def linspace(
133133
self,
134134
/,
135135
n: SupportsIndex = 100,
136136
domain: CoComplex_1d | None = None,
137-
) -> _Tuple2[Array_1d[np.float64 | np.complex128]]: ...
137+
) -> tuple[Array_1d[np.float64 | np.complex128], Array_1d[np.float64 | np.complex128]]: ...
138138

139139
#
140140
@overload
@@ -200,7 +200,7 @@ class ABCPolyBase(abc.ABC):
200200
@classmethod
201201
def basis(
202202
cls,
203-
deg: _ToInt,
203+
deg: SupportsIndex,
204204
domain: CoComplex_1d | None = None,
205205
window: CoComplex_1d | None = None,
206206
symbol: str = "x",

0 commit comments

Comments
 (0)