@@ -88,7 +88,6 @@ from pandas._typing import (
8888 HashableT ,
8989 HashableT1 ,
9090 HashableT2 ,
91- HashableT3 ,
9291 IgnoreRaise ,
9392 IndexingInt ,
9493 IndexLabel ,
@@ -175,13 +174,13 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
175174 @overload
176175 def __getitem__ (self , idx : Scalar ) -> Series | _T : ...
177176 @overload
178- def __getitem__ (
177+ def __getitem__ ( # type: ignore[overload-overlap]
179178 self ,
180179 idx : (
181180 IndexType
182181 | MaskType
183- | Callable [[DataFrame ], IndexType | MaskType | list [ HashableT ]]
184- | list [HashableT ]
182+ | Callable [[DataFrame ], IndexType | MaskType | Sequence [ Hashable ]]
183+ | list [Hashable ]
185184 | tuple [
186185 IndexType
187186 | MaskType
@@ -236,7 +235,7 @@ class _LocIndexerFrame(_LocIndexer, Generic[_T]):
236235 @overload
237236 def __setitem__ (
238237 self ,
239- idx : tuple [_IndexSliceTuple , HashableT ],
238+ idx : tuple [_IndexSliceTuple , Hashable ],
240239 value : Scalar | NAType | NaTType | ArrayLike | Series | list | None ,
241240 ) -> None : ...
242241
@@ -432,10 +431,10 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
432431 self ,
433432 index : _bool = ...,
434433 column_dtypes : (
435- _str | npt .DTypeLike | Mapping [HashableT1 , npt .DTypeLike ] | None
434+ _str | npt .DTypeLike | Mapping [Hashable , npt .DTypeLike ] | None
436435 ) = ...,
437436 index_dtypes : (
438- _str | npt .DTypeLike | Mapping [HashableT2 , npt .DTypeLike ] | None
437+ _str | npt .DTypeLike | Mapping [Hashable , npt .DTypeLike ] | None
439438 ) = ...,
440439 ) -> np .recarray : ...
441440 def to_stata (
@@ -449,7 +448,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
449448 data_label : _str | None = ...,
450449 variable_labels : dict [HashableT2 , str ] | None = ...,
451450 version : Literal [114 , 117 , 118 , 119 ] | None = ...,
452- convert_strl : list [HashableT3 ] | None = ...,
451+ convert_strl : list [Hashable ] | None = ...,
453452 compression : CompressionOptions = ...,
454453 storage_options : StorageOptions = ...,
455454 value_labels : dict [Hashable , dict [float , str ]] | None = ...,
@@ -462,7 +461,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
462461 engine : ParquetEngine = ...,
463462 compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
464463 index : bool | None = ...,
465- partition_cols : list [ HashableT ] | None = ...,
464+ partition_cols : Sequence [ Hashable ] | None = ...,
466465 storage_options : StorageOptions = ...,
467466 ** kwargs : Any ,
468467 ) -> None : ...
@@ -473,7 +472,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
473472 engine : ParquetEngine = ...,
474473 compression : Literal ["snappy" , "gzip" , "brotli" , "lz4" , "zstd" ] | None = ...,
475474 index : bool | None = ...,
476- partition_cols : list [ HashableT ] | None = ...,
475+ partition_cols : Sequence [ Hashable ] | None = ...,
477476 storage_options : StorageOptions = ...,
478477 ** kwargs : Any ,
479478 ) -> bytes : ...
@@ -499,7 +498,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
499498 def to_html (
500499 self ,
501500 buf : FilePath | WriteBuffer [str ],
502- columns : list [HashableT ] | Index | Series | None = ...,
501+ columns : list [Hashable ] | Index | Series | None = ...,
503502 col_space : ColspaceArgType | None = ...,
504503 header : _bool = ...,
505504 index : _bool = ...,
@@ -546,7 +545,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
546545 def to_html (
547546 self ,
548547 buf : None = ...,
549- columns : Sequence [HashableT ] | None = ...,
548+ columns : Sequence [Hashable ] | None = ...,
550549 col_space : ColspaceArgType | None = ...,
551550 header : _bool = ...,
552551 index : _bool = ...,
@@ -597,8 +596,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
597596 root_name : str = ...,
598597 row_name : str = ...,
599598 na_rep : str | None = ...,
600- attr_cols : list [HashableT1 ] | None = ...,
601- elem_cols : list [HashableT2 ] | None = ...,
599+ attr_cols : list [Hashable ] | None = ...,
600+ elem_cols : list [Hashable ] | None = ...,
602601 namespaces : dict [str | None , str ] | None = ...,
603602 prefix : str | None = ...,
604603 encoding : str = ...,
@@ -617,8 +616,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
617616 root_name : str | None = ...,
618617 row_name : str | None = ...,
619618 na_rep : str | None = ...,
620- attr_cols : list [HashableT1 ] | None = ...,
621- elem_cols : list [HashableT2 ] | None = ...,
619+ attr_cols : list [Hashable ] | None = ...,
620+ elem_cols : list [Hashable ] | None = ...,
622621 namespaces : dict [str | None , str ] | None = ...,
623622 prefix : str | None = ...,
624623 encoding : str = ...,
@@ -846,7 +845,12 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
846845 def set_index (
847846 self ,
848847 keys : (
849- Label | Series | Index | np .ndarray | Iterator [HashableT ] | list [HashableT ]
848+ Label
849+ | Series
850+ | Index
851+ | np .ndarray
852+ | Iterator [Hashable ]
853+ | Sequence [Hashable ]
850854 ),
851855 * ,
852856 drop : _bool = ...,
@@ -858,7 +862,12 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
858862 def set_index (
859863 self ,
860864 keys : (
861- Label | Series | Index | np .ndarray | Iterator [HashableT ] | list [HashableT ]
865+ Label
866+ | Series
867+ | Index
868+ | np .ndarray
869+ | Iterator [Hashable ]
870+ | Sequence [Hashable ]
862871 ),
863872 * ,
864873 drop : _bool = ...,
@@ -876,7 +885,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
876885 col_fill : Hashable = ...,
877886 inplace : Literal [True ],
878887 allow_duplicates : _bool = ...,
879- names : Hashable | list [ HashableT ] = ...,
888+ names : Hashable | Sequence [ Hashable ] = ...,
880889 ) -> None : ...
881890 @overload
882891 def reset_index (
@@ -888,7 +897,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
888897 drop : _bool = ...,
889898 inplace : Literal [False ] = ...,
890899 allow_duplicates : _bool = ...,
891- names : Hashable | list [ HashableT ] = ...,
900+ names : Hashable | Sequence [ Hashable ] = ...,
892901 ) -> Self : ...
893902 @overload
894903 def reset_index (
@@ -900,7 +909,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
900909 col_level : int | _str = ...,
901910 col_fill : Hashable = ...,
902911 allow_duplicates : _bool = ...,
903- names : Hashable | list [ HashableT ] = ...,
912+ names : Hashable | Sequence [ Hashable ] = ...,
904913 ) -> Self | None : ...
905914 def isna (self ) -> Self : ...
906915 def isnull (self ) -> Self : ...
@@ -1681,7 +1690,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
16811690 def columns (self ) -> Index [str ]: ...
16821691 @columns .setter # setter needs to be right next to getter; otherwise mypy complains
16831692 def columns (
1684- self , cols : AnyArrayLike | list [HashableT ] | tuple [HashableT , ...]
1693+ self , cols : AnyArrayLike | list [Hashable ] | tuple [Hashable , ...]
16851694 ) -> None : ...
16861695 @property
16871696 def dtypes (self ) -> Series : ...
@@ -2359,8 +2368,8 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23592368 def to_string (
23602369 self ,
23612370 buf : FilePath | WriteBuffer [str ],
2362- columns : list [ HashableT1 ] | Index | Series | None = ...,
2363- col_space : int | list [int ] | dict [HashableT2 , int ] | None = ...,
2371+ columns : Sequence [ Hashable ] | Index | Series | None = ...,
2372+ col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
23642373 header : _bool | list [_str ] | tuple [str , ...] = ...,
23652374 index : _bool = ...,
23662375 na_rep : _str = ...,
@@ -2382,7 +2391,7 @@ class DataFrame(NDFrame, OpsMixin, _GetItemHack):
23822391 def to_string (
23832392 self ,
23842393 buf : None = ...,
2385- columns : list [ HashableT ] | Index | Series | None = ...,
2394+ columns : Sequence [ Hashable ] | Index | Series | None = ...,
23862395 col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
23872396 header : _bool | Sequence [_str ] = ...,
23882397 index : _bool = ...,
0 commit comments