File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
from datetime import timedelta
2
2
import operator
3
3
from sys import getsizeof
4
+ from typing import Union
4
5
import warnings
5
6
6
7
import numpy as np
@@ -334,7 +335,7 @@ def is_monotonic_decreasing(self):
334
335
def has_duplicates (self ):
335
336
return False
336
337
337
- def __contains__ (self , key ) :
338
+ def __contains__ (self , key : Union [ int , np . integer ]) -> bool :
338
339
hash (key )
339
340
try :
340
341
key = ensure_python_int (key )
@@ -648,10 +649,10 @@ def __floordiv__(self, other):
648
649
return self ._simple_new (start , start + 1 , 1 , name = self .name )
649
650
return self ._int64index // other
650
651
651
- def all (self ):
652
+ def all (self ) -> bool :
652
653
return 0 not in self ._range
653
654
654
- def any (self ):
655
+ def any (self ) -> bool :
655
656
return any (self ._range )
656
657
657
658
@classmethod
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ def test_dtype(self):
247
247
def test_cached_data (self ):
248
248
# GH 26565, GH26617
249
249
# Calling RangeIndex._data caches an int64 array of the same length at
250
- # self._cached_data. This tests whether _cached_data has been set.
250
+ # self._cached_data. This test checks whether _cached_data has been set
251
251
idx = RangeIndex (0 , 100 , 10 )
252
252
253
253
assert idx ._cached_data is None
You can’t perform that action at this time.
0 commit comments