The use of `none` here is confusing.

Why not do:

```

# if ul and lr arrays are out of bounds, then we return None
with nogil:
  ...
  if ul[idx] >= lr[idx]: return None