diff --git a/pandas/core/indexes/numeric.py b/pandas/core/indexes/numeric.py index 465f21da1278a..fa79c1f1a528f 100644 --- a/pandas/core/indexes/numeric.py +++ b/pandas/core/indexes/numeric.py @@ -347,8 +347,7 @@ def _assert_safe_casting(cls, data, subarr): def _is_compatible_with_other(self, other): return super()._is_compatible_with_other(other) or all( - isinstance(type(obj), (ABCUInt64Index, ABCFloat64Index)) - for obj in [self, other] + isinstance(obj, (ABCUInt64Index, ABCFloat64Index)) for obj in [self, other] ) @@ -497,8 +496,7 @@ def isin(self, values, level=None): def _is_compatible_with_other(self, other): return super()._is_compatible_with_other(other) or all( isinstance( - type(obj), - (ABCInt64Index, ABCFloat64Index, ABCUInt64Index, ABCRangeIndex), + obj, (ABCInt64Index, ABCFloat64Index, ABCUInt64Index, ABCRangeIndex), ) for obj in [self, other] )