Also, I think the code would be clearer as:
```
if np.size(limits, 0) != 2 or not np.any(np.isfinite(limits)):
    raise ValueError('Bounds should be a sequence containing ...')
```
Or even maybe with a specific error message for non-finite value.