@@ -1633,6 +1633,14 @@ _ArrayTD64_co = NDArray[Union[bool_, integer[Any], timedelta64]]
1633
1633
class _SupportsItem (Protocol [_T_co ]):
1634
1634
def item (self , __args : Any ) -> _T_co : ...
1635
1635
1636
+ class _SupportsReal (Protocol [_T_co ]):
1637
+ @property
1638
+ def real (self ) -> _T_co : ...
1639
+
1640
+ class _SupportsImag (Protocol [_T_co ]):
1641
+ @property
1642
+ def imag (self ) -> _T_co : ...
1643
+
1636
1644
class ndarray (_ArrayOrScalarCommon , Generic [_ShapeType , _DType_co ]):
1637
1645
@property
1638
1646
def base (self ) -> Optional [ndarray ]: ...
@@ -1641,11 +1649,15 @@ class ndarray(_ArrayOrScalarCommon, Generic[_ShapeType, _DType_co]):
1641
1649
@property
1642
1650
def size (self ) -> int : ...
1643
1651
@property
1644
- def real (self : _ArraySelf ) -> _ArraySelf : ...
1652
+ def real (
1653
+ self : NDArray [_SupportsReal [_ScalarType ]], # type: ignore[type-var]
1654
+ ) -> ndarray [_ShapeType , dtype [_ScalarType ]]: ...
1645
1655
@real .setter
1646
1656
def real (self , value : ArrayLike ) -> None : ...
1647
1657
@property
1648
- def imag (self : _ArraySelf ) -> _ArraySelf : ...
1658
+ def imag (
1659
+ self : NDArray [_SupportsImag [_ScalarType ]], # type: ignore[type-var]
1660
+ ) -> ndarray [_ShapeType , dtype [_ScalarType ]]: ...
1649
1661
@imag .setter
1650
1662
def imag (self , value : ArrayLike ) -> None : ...
1651
1663
def __new__ (
0 commit comments