File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,15 +92,15 @@ def imag(val: _nt.ToGeneric_nd) -> _nt.Array: ...
9292
9393#
9494@overload
95- def iscomplex (x : _nt .ToGeneric_0d ) -> np .bool : ...
96- @overload
9795def iscomplex (x : _nt .ToGeneric_1nd ) -> _nt .Array [np .bool ]: ...
96+ @overload
97+ def iscomplex (x : np .generic | _nt ._PyScalar ) -> np .bool : ...
9898
9999#
100100@overload
101- def isreal (x : _nt .ToGeneric_0d ) -> np .bool : ...
102- @overload
103101def isreal (x : _nt .ToGeneric_1nd ) -> _nt .Array [np .bool ]: ...
102+ @overload
103+ def isreal (x : np .generic | _nt ._PyScalar ) -> np .bool : ...
104104
105105#
106106def iscomplexobj (x : _HasDType [Any ] | _nt .ToGeneric_nd ) -> bool : ...
@@ -131,13 +131,13 @@ def nan_to_num(
131131# If one passes a complex array to `real_if_close`, then one is reasonably
132132# expected to verify the output dtype (so we can return an unsafe union here)
133133
134- @overload
135- def real_if_close (a : _nt .ToCLongDouble_nd , tol : float = 100 ) -> _nt .Array [_nt .inexact64l ]: ...
136134@overload
137135def real_if_close (a : _nt .ToComplex128_nd , tol : float = 100 ) -> _nt .Array [_nt .inexact64 ]: ...
138136@overload
139137def real_if_close (a : _nt .ToComplex64_nd , tol : float = 100 ) -> _nt .Array [_nt .inexact32 ]: ...
140138@overload
139+ def real_if_close (a : _nt .ToCLongDouble_nd , tol : float = 100 ) -> _nt .Array [_nt .inexact64l ]: ...
140+ @overload
141141def real_if_close (a : _nt ._ToArray_nd [_RealT ], tol : float = 100 ) -> _nt .Array [_RealT ]: ...
142142@overload
143143def real_if_close (a : _nt .ToGeneric_nd , tol : float = 100 ) -> _nt .Array : ...
You can’t perform that action at this time.
0 commit comments