@@ -1645,6 +1645,14 @@ _ArrayTD64_co = NDArray[Union[bool_, integer[Any], timedelta64]]
1645
1645
class _SupportsItem (Protocol [_T_co ]):
1646
1646
def item (self , __args : Any ) -> _T_co : ...
1647
1647
1648
+ class _SupportsReal (Protocol [_T_co ]):
1649
+ @property
1650
+ def real (self ) -> _T_co : ...
1651
+
1652
+ class _SupportsImag (Protocol [_T_co ]):
1653
+ @property
1654
+ def imag (self ) -> _T_co : ...
1655
+
1648
1656
class ndarray (_ArrayOrScalarCommon , Generic [_ShapeType , _DType_co ]):
1649
1657
@property
1650
1658
def base (self ) -> Optional [ndarray ]: ...
@@ -1653,11 +1661,15 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
1653
1661
@property
1654
1662
def size (self ) -> int : ...
1655
1663
@property
1656
- def real (self : _ArraySelf ) -> _ArraySelf : ...
1664
+ def real (
1665
+ self : NDArray [_SupportsReal [_ScalarType ]], # type: ignore[type-var]
1666
+ ) -> ndarray [_ShapeType , dtype [_ScalarType ]]: ...
1657
1667
@real .setter
1658
1668
def real (self , value : ArrayLike ) -> None : ...
1659
1669
@property
1660
- def imag (self : _ArraySelf ) -> _ArraySelf : ...
1670
+ def imag (
1671
+ self : NDArray [_SupportsImag [_ScalarType ]], # type: ignore[type-var]
1672
+ ) -> ndarray [_ShapeType , dtype [_ScalarType ]]: ...
1661
1673
@imag .setter
1662
1674
def imag (self , value : ArrayLike ) -> None : ...
1663
1675
def __new__ (
0 commit comments