numpy,sort uses ValueError (thus I used it here as partition is very related)
ufuncs use IndexError so maybe it would be a good idea to change sort and partition to indexerror too