@@ -215,7 +215,7 @@ def join(
215
215
return cast (F , join )
216
216
217
217
218
- def disallow_kwargs (kwargs : dict [str , Any ]):
218
+ def disallow_kwargs (kwargs : dict [str , Any ]) -> None :
219
219
if kwargs :
220
220
raise TypeError (f"Unexpected keyword arguments { repr (set (kwargs ))} " )
221
221
@@ -626,7 +626,7 @@ def _maybe_check_unique(self) -> None:
626
626
raise DuplicateLabelError (msg )
627
627
628
628
@final
629
- def _format_duplicate_message (self ):
629
+ def _format_duplicate_message (self ) -> DataFrame :
630
630
"""
631
631
Construct the DataFrame for a DuplicateLabelError.
632
632
@@ -789,7 +789,7 @@ def __array_wrap__(self, result, context=None):
789
789
return Index (result , ** attrs )
790
790
791
791
@cache_readonly
792
- def dtype (self ):
792
+ def dtype (self ) -> DtypeObj :
793
793
"""
794
794
Return the dtype object of the underlying data.
795
795
"""
@@ -1064,11 +1064,11 @@ def copy(
1064
1064
return new_index
1065
1065
1066
1066
@final
1067
- def __copy__ (self , ** kwargs ):
1067
+ def __copy__ (self : _IndexT , ** kwargs ) -> _IndexT :
1068
1068
return self .copy (** kwargs )
1069
1069
1070
1070
@final
1071
- def __deepcopy__ (self , memo = None ):
1071
+ def __deepcopy__ (self : _IndexT , memo = None ) -> _IndexT :
1072
1072
"""
1073
1073
Parameters
1074
1074
----------
@@ -1354,7 +1354,7 @@ def to_series(self, index=None, name: Hashable = None) -> Series:
1354
1354
1355
1355
return Series (self ._values .copy (), index = index , name = name )
1356
1356
1357
- def to_frame (self , index : bool = True , name = None ) -> DataFrame :
1357
+ def to_frame (self , index : bool = True , name : Hashable = None ) -> DataFrame :
1358
1358
"""
1359
1359
Create a DataFrame with a column containing the Index.
1360
1360
@@ -1426,7 +1426,7 @@ def name(self):
1426
1426
return self ._name
1427
1427
1428
1428
@name .setter
1429
- def name (self , value ):
1429
+ def name (self , value : Hashable ):
1430
1430
if self ._no_setting_name :
1431
1431
# Used in MultiIndex.levels to avoid silently ignoring name updates.
1432
1432
raise RuntimeError (
@@ -2367,7 +2367,7 @@ def _is_all_dates(self) -> bool:
2367
2367
2368
2368
@cache_readonly
2369
2369
@final
2370
- def is_all_dates (self ):
2370
+ def is_all_dates (self ) -> bool :
2371
2371
"""
2372
2372
Whether or not the index values only consist of dates.
2373
2373
"""
0 commit comments