@@ -43,8 +43,12 @@ _TI = TypeVar("_TI", bound=Series[int] | Index[int])
43
43
_TE = TypeVar ("_TE" , bound = Series [bytes ] | Index [bytes ])
44
44
# The _TD type is what is used for the result of str.encode
45
45
_TD = TypeVar ("_TD" , bound = Series [str ] | Index [str ])
46
+ # The _TO type is what is used for the result of str.encode
47
+ _TO = TypeVar ("_TO" , bound = Series [type [object ]] | Index [type [object ]])
46
48
47
- class StringMethods (NoNewAttributesMixin , Generic [T , _TS , _TM , _TS2 , _TI , _TE , _TD ]):
49
+ class StringMethods (
50
+ NoNewAttributesMixin , Generic [T , _TS , _TM , _TS2 , _TI , _TE , _TD , _TO ]
51
+ ):
48
52
def __init__ (self , data : T ) -> None : ...
49
53
def __getitem__ (self , key : slice | int ) -> T : ...
50
54
def __iter__ (self ) -> T : ...
@@ -101,23 +105,19 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM, _TS2, _TI, _TE, _
101
105
@overload
102
106
def partition (self , sep : str , expand : Literal [True ]) -> _TS : ...
103
107
@overload
104
- def partition (
105
- self , sep : str , expand : Literal [False ]
106
- ) -> pd .Series [type [object ]]: ...
108
+ def partition (self , sep : str , expand : Literal [False ]) -> _TO : ...
107
109
@overload
108
- def partition (self , * , expand : Literal [False ]) -> pd . Series [ type [ object ]] : ...
110
+ def partition (self , * , expand : Literal [False ]) -> _TO : ...
109
111
@overload
110
112
def rpartition (self , sep : str = ...) -> _TS : ...
111
113
@overload
112
- def rpartition (self , * , expand : Literal [True ]) -> pd . DataFrame : ...
114
+ def rpartition (self , * , expand : Literal [True ]) -> _TS : ...
113
115
@overload
114
- def rpartition (self , sep : str , expand : Literal [True ]) -> pd . DataFrame : ...
116
+ def rpartition (self , sep : str , expand : Literal [True ]) -> _TS : ...
115
117
@overload
116
- def rpartition (
117
- self , sep : str , expand : Literal [False ]
118
- ) -> pd .Series [type [object ]]: ...
118
+ def rpartition (self , sep : str , expand : Literal [False ]) -> _TO : ...
119
119
@overload
120
- def rpartition (self , * , expand : Literal [False ]) -> pd . Series [ type [ object ]] : ...
120
+ def rpartition (self , * , expand : Literal [False ]) -> _TO : ...
121
121
def get (self , i : int ) -> T : ...
122
122
def join (self , sep : str ) -> _TD : ...
123
123
def contains (
@@ -180,7 +180,7 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM, _TS2, _TI, _TE, _
180
180
@overload
181
181
def extract (
182
182
self , pat : str , flags : int = ..., * , expand : Literal [True ] = ...
183
- ) -> _TS : ...
183
+ ) -> pd . DataFrame : ...
184
184
@overload
185
185
def extract (
186
186
self , pat : str , flags : int , expand : Literal [False ]
@@ -189,7 +189,7 @@ class StringMethods(NoNewAttributesMixin, Generic[T, _TS, _TM, _TS2, _TI, _TE, _
189
189
def extract (
190
190
self , pat : str , flags : int = ..., * , expand : Literal [False ]
191
191
) -> Series [type [object ]]: ...
192
- def extractall (self , pat : str , flags : int = ...) -> _TS : ...
192
+ def extractall (self , pat : str , flags : int = ...) -> pd . DataFrame : ...
193
193
def find (self , sub : str , start : int = ..., end : int | None = ...) -> _TI : ...
194
194
def rfind (self , sub : str , start : int = ..., end : int | None = ...) -> _TI : ...
195
195
def normalize (self , form : Literal ["NFC" , "NFKC" , "NFD" , "NFKD" ]) -> T : ...
0 commit comments