def overlap_x r1 r2 return not r1 r2 or r1 r2

1
2
def overlap_x(r1, r2):
return not ((r1[0] > r2[2]) or (r1[2] < r2[0]))