Skip to content

Commit 418e2e4

Browse files
committed
TYP: Also allow passing bool_ to QuadPrecision.__new__
1 parent e5a5fe4 commit 418e2e4

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

quaddtype/numpy_quaddtype/_quaddtype_main.pyi

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import numpy as np
44
from typing_extensions import Never, Self, override
55

66
_Backend: TypeAlias = Literal["sleef", "longdouble"]
7-
_IntoQuad: TypeAlias = QuadPrecision | float | str | np.floating[Any] | np.integer[Any]
8-
_CastsQuad: TypeAlias = _IntoQuad | np.bool_
7+
_IntoQuad: TypeAlias = (
8+
QuadPrecision
9+
| float
10+
| str
11+
| np.floating[Any]
12+
| np.integer[Any]
13+
| np.bool_
14+
) # fmt: skip
915

1016
@final
1117
class QuadPrecDType(np.dtype[QuadPrecision]): # type: ignore[misc, type-var] # pyright: ignore[reportGeneralTypeIssues, reportInvalidTypeArguments]
@@ -87,16 +93,16 @@ class QuadPrecision:
8793
def __ge__(self, other: _IntoQuad, /) -> bool: ...
8894

8995
# Binary operators
90-
def __add__(self, other: _CastsQuad, /) -> Self: ...
91-
def __radd__(self, other: _CastsQuad, /) -> Self: ...
92-
def __sub__(self, other: _CastsQuad, /) -> Self: ...
93-
def __rsub__(self, other: _CastsQuad, /) -> Self: ...
94-
def __mul__(self, other: _CastsQuad, /) -> Self: ...
95-
def __rmul__(self, other: _CastsQuad, /) -> Self: ...
96-
def __pow__(self, other: _CastsQuad, mod: None = None, /) -> Self: ...
97-
def __rpow__(self, other: _CastsQuad, mod: None = None, /) -> Self: ...
98-
def __truediv__(self, other: _CastsQuad, /) -> Self: ...
99-
def __rtruediv__(self, other: _CastsQuad, /) -> Self: ...
96+
def __add__(self, other: _IntoQuad, /) -> Self: ...
97+
def __radd__(self, other: _IntoQuad, /) -> Self: ...
98+
def __sub__(self, other: _IntoQuad, /) -> Self: ...
99+
def __rsub__(self, other: _IntoQuad, /) -> Self: ...
100+
def __mul__(self, other: _IntoQuad, /) -> Self: ...
101+
def __rmul__(self, other: _IntoQuad, /) -> Self: ...
102+
def __pow__(self, other: _IntoQuad, mod: None = None, /) -> Self: ...
103+
def __rpow__(self, other: _IntoQuad, mod: None = None, /) -> Self: ...
104+
def __truediv__(self, other: _IntoQuad, /) -> Self: ...
105+
def __rtruediv__(self, other: _IntoQuad, /) -> Self: ...
100106

101107
# Unary operators
102108
def __neg__(self, /) -> Self: ...

0 commit comments

Comments
 (0)