Could you do something like:
```
if not np.uint32(N) == N:
    raise ValueError(...)
```
I wonder if there is some trick like this that would take care of all the checking in one line.