@@ -314,17 +314,17 @@ def _simple_new(
314
314
f"right [{ type (right ).__name__ } ] types"
315
315
)
316
316
raise ValueError (msg )
317
- elif is_categorical_dtype (left .dtype ) or is_string_dtype (left .dtype ):
317
+ if is_categorical_dtype (left .dtype ) or is_string_dtype (left .dtype ):
318
318
# GH 19016
319
319
msg = (
320
320
"category, object, and string subtypes are not supported "
321
321
"for IntervalArray"
322
322
)
323
323
raise TypeError (msg )
324
- elif isinstance (left , ABCPeriodIndex ):
324
+ if isinstance (left , ABCPeriodIndex ):
325
325
msg = "Period dtypes are not supported, use a PeriodIndex instead"
326
326
raise ValueError (msg )
327
- elif isinstance (left , ABCDatetimeIndex ) and str (left .tz ) != str (right .tz ):
327
+ if isinstance (left , ABCDatetimeIndex ) and str (left .tz ) != str (right .tz ):
328
328
msg = (
329
329
"left and right must have the same time zone, got "
330
330
f"'{ left .tz } ' and '{ right .tz } '"
@@ -1321,7 +1321,7 @@ def mid(self) -> Index:
1321
1321
def overlaps (self , other ):
1322
1322
if isinstance (other , (IntervalArray , ABCIntervalIndex )):
1323
1323
raise NotImplementedError
1324
- elif not isinstance (other , Interval ):
1324
+ if not isinstance (other , Interval ):
1325
1325
msg = f"`other` must be Interval-like, got { type (other ).__name__ } "
1326
1326
raise TypeError (msg )
1327
1327
0 commit comments