Skip to content

Commit c6ba046

Browse files
simonjayhawkinsTomAugspurger
authored andcommitted
pandas\core\indexing.py:2227: error: Implicit generic "Any". Use "typing.Tuple" and specify generic parameters
1 parent 5511ea4 commit c6ba046

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/core/indexing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Tuple
1+
from typing import Hashable, List, Tuple, Union
22

33
import numpy as np
44

@@ -2224,7 +2224,7 @@ def _convert_key(self, key, is_setter: bool = False):
22242224
return key
22252225

22262226

2227-
def _tuplify(ndim: int, loc) -> tuple:
2227+
def _tuplify(ndim: int, loc: Hashable) -> Tuple[Union[Hashable, slice], ...]:
22282228
"""
22292229
Given an indexer for the first dimension, create an equivalent tuple
22302230
for indexing over all dimensions.
@@ -2238,9 +2238,10 @@ def _tuplify(ndim: int, loc) -> tuple:
22382238
-------
22392239
tuple
22402240
"""
2241-
tup = [slice(None, None) for _ in range(ndim)]
2242-
tup[0] = loc
2243-
return tuple(tup)
2241+
_tup: List[Union[Hashable, slice]]
2242+
_tup = [slice(None, None) for _ in range(ndim)]
2243+
_tup[0] = loc
2244+
return tuple(_tup)
22442245

22452246

22462247
def convert_to_index_sliceable(obj, key):

0 commit comments

Comments
 (0)