File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,15 @@ cdef class Interval(IntervalMixin):
414
414
if _interval_like(key ):
415
415
key_closed_left = key.inclusive in (' left' , ' both' )
416
416
key_closed_right = key.inclusive in (' right' , ' both' )
417
- return ((self .left < key.left if self .open_left and key_closed_left else self .left <= key.left) and
418
- (key.right < self .right if self .open_right and key_closed_right else key.right <= self .right))
417
+ if self .open_left and key_closed_left:
418
+ left_contained = self .left < key.left
419
+ else :
420
+ left_contained = self .left <= key.left
421
+ if self .open_right and key_closed_right:
422
+ right_contained = key.right < self .right
423
+ else :
424
+ right_contained = key.right <= self .right
425
+ return left_contained and right_contained
419
426
return ((self .left < key if self .open_left else self .left <= key) and
420
427
(key < self .right if self .open_right else key <= self .right))
421
428
You can’t perform that action at this time.
0 commit comments