@@ -5145,9 +5145,7 @@ def set_index(
5145
5145
return frame
5146
5146
5147
5147
@overload
5148
- # https://github.com/python/mypy/issues/6580
5149
- # Overloaded function signatures 1 and 2 overlap with incompatible return types
5150
- def reset_index ( # type: ignore[misc]
5148
+ def reset_index (
5151
5149
self ,
5152
5150
level : Optional [Union [Hashable , Sequence [Hashable ]]] = ...,
5153
5151
drop : bool = ...,
@@ -5157,15 +5155,58 @@ def reset_index( # type: ignore[misc]
5157
5155
) -> DataFrame :
5158
5156
...
5159
5157
5158
+ @overload
5159
+ def reset_index (
5160
+ self ,
5161
+ level : Optional [Union [Hashable , Sequence [Hashable ]]],
5162
+ drop : bool ,
5163
+ inplace : Literal [True ],
5164
+ col_level : Hashable = ...,
5165
+ col_fill : Hashable = ...,
5166
+ ) -> None :
5167
+ ...
5168
+
5169
+ @overload
5170
+ def reset_index (
5171
+ self ,
5172
+ * ,
5173
+ drop : bool ,
5174
+ inplace : Literal [True ],
5175
+ col_level : Hashable = ...,
5176
+ col_fill : Hashable = ...,
5177
+ ) -> None :
5178
+ ...
5179
+
5180
+ @overload
5181
+ def reset_index (
5182
+ self ,
5183
+ * ,
5184
+ level : Optional [Union [Hashable , Sequence [Hashable ]]],
5185
+ inplace : Literal [True ],
5186
+ col_level : Hashable = ...,
5187
+ col_fill : Hashable = ...,
5188
+ ) -> None :
5189
+ ...
5190
+
5191
+ @overload
5192
+ def reset_index (
5193
+ self ,
5194
+ * ,
5195
+ inplace : Literal [True ],
5196
+ col_level : Hashable = ...,
5197
+ col_fill : Hashable = ...,
5198
+ ) -> None :
5199
+ ...
5200
+
5160
5201
@overload
5161
5202
def reset_index (
5162
5203
self ,
5163
5204
level : Optional [Union [Hashable , Sequence [Hashable ]]] = ...,
5164
5205
drop : bool = ...,
5165
- inplace : Literal [ True ] = ...,
5206
+ inplace : bool = ...,
5166
5207
col_level : Hashable = ...,
5167
5208
col_fill : Hashable = ...,
5168
- ) -> None :
5209
+ ) -> Optional [ DataFrame ] :
5169
5210
...
5170
5211
5171
5212
def reset_index (
0 commit comments