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 11from datetime import timedelta
22import operator
33from sys import getsizeof
4+ from typing import Union
45import warnings
56
67import numpy as np
@@ -334,7 +335,7 @@ def is_monotonic_decreasing(self):
334335 def has_duplicates (self ):
335336 return False
336337
337- def __contains__ (self , key ) :
338+ def __contains__ (self , key : Union [ int , np . integer ]) -> bool :
338339 hash (key )
339340 try :
340341 key = ensure_python_int (key )
@@ -648,10 +649,10 @@ def __floordiv__(self, other):
648649 return self ._simple_new (start , start + 1 , 1 , name = self .name )
649650 return self ._int64index // other
650651
651- def all (self ):
652+ def all (self ) -> bool :
652653 return 0 not in self ._range
653654
654- def any (self ):
655+ def any (self ) -> bool :
655656 return any (self ._range )
656657
657658 @classmethod
Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ def test_dtype(self):
247247 def test_cached_data (self ):
248248 # GH 26565, GH26617
249249 # 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
251251 idx = RangeIndex (0 , 100 , 10 )
252252
253253 assert idx ._cached_data is None
You can’t perform that action at this time.
0 commit comments