@@ -14,6 +14,9 @@ from typing_extensions import Self
1414from pandas ._typing import (
1515 AnyArrayLikeInt ,
1616 ArrayLike ,
17+ AstypeArg ,
18+ Dtype ,
19+ ListLike ,
1720 Scalar ,
1821 ScalarIndexer ,
1922 SequenceIndexer ,
@@ -50,16 +53,36 @@ class ExtensionArray:
5053 def ndim (self ) -> int : ...
5154 @property
5255 def nbytes (self ) -> int : ...
53- def astype (self , dtype , copy : bool = True ): ...
56+ @overload
57+ def astype (self , dtype : np .dtype , copy : bool = True ) -> np_1darray : ...
58+ @overload
59+ def astype (self , dtype : ExtensionDtype , copy : bool = True ) -> ExtensionArray : ...
60+ @overload
61+ def astype (self , dtype : AstypeArg , copy : bool = True ) -> ArrayLike : ...
5462 def isna (self ) -> ArrayLike : ...
5563 def argsort (
5664 self , * , ascending : bool = ..., kind : str = ..., ** kwargs : Any
5765 ) -> np_1darray : ...
58- def fillna (self , value = ..., method = None , limit = None ): ...
66+ def fillna (
67+ self , value : object | ArrayLike , limit : int | None = None , copy : bool = True
68+ ) -> Self : ...
5969 def dropna (self ) -> Self : ...
6070 def shift (self , periods : int = 1 , fill_value : object = ...) -> Self : ...
6171 def unique (self ) -> Self : ...
62- def searchsorted (self , value , side : str = ..., sorter = ...): ...
72+ @overload
73+ def searchsorted (
74+ self ,
75+ value : ListLike ,
76+ side : Literal ["left" , "right" ] = ...,
77+ sorter : ListLike | None = ...,
78+ ) -> np_1darray [np .intp ]: ...
79+ @overload
80+ def searchsorted (
81+ self ,
82+ value : Scalar ,
83+ side : Literal ["left" , "right" ] = ...,
84+ sorter : ListLike | None = ...,
85+ ) -> np .intp : ...
6386 def factorize (self , use_na_sentinel : bool = True ) -> tuple [np_1darray , Self ]: ...
6487 def repeat (
6588 self , repeats : int | AnyArrayLikeInt | Sequence [int ], axis : None = None
@@ -72,11 +95,14 @@ class ExtensionArray:
7295 fill_value : Any = None ,
7396 ) -> Self : ...
7497 def copy (self ) -> Self : ...
75- def view (self , dtype = ...) -> Self | np_1darray : ...
98+ @overload
99+ def view (self , dtype : None = None ) -> Self : ...
100+ @overload
101+ def view (self , dtype : Dtype ) -> ArrayLike : ...
76102 def ravel (self , order : Literal ["C" , "F" , "A" , "K" ] | None = "C" ) -> Self : ...
77- def tolist (self ) -> list : ...
103+ def tolist (self ) -> list [ Any ] : ...
78104 def _reduce (
79- self , name : str , * , skipna : bool = ... , keepdims : bool = ... , ** kwargs : Any
105+ self , name : str , * , skipna : bool = True , keepdims : bool = False , ** kwargs : Any
80106 ) -> object : ...
81107 def _accumulate (
82108 self ,
0 commit comments