I forgot to mention this earlier, sorry for the noise... If the user passes in a negative `axis` that is out of bounds, the error message will be confusing, because you will be reporting the value **after adding `a.ndim`**, not the value the user entered. You probably want to use another variable to store the original value. There has to be some example of this in the Python code base, but I can't seem to find any. [Here](https://github.com/numpy/numpy/blob/91fa07e8ec35f613c83afb7bbdcfb8bf9e7861ec/numpy/core/src/multiarray/item_selection.c#L1264) is how `partition` does it in the C code.