[Numpy-discussion] Correct error of invalid axis arguments.

Charles R Harris charlesr.harris at gmail.com
Mon Sep 5 13:54:57 EDT 2016


Hi All,

At the moment there are two error types raised when invalid axis arguments
are encountered: IndexError and ValueError. I prefer ValueError for
arguments, IndexError seems more appropriate when the bad axis value is
used as an index. In any case, having mixed error types is inconvenient,
but also inconvenient to change. Should we worry about that? If so, what
should the error be? Note that some of the mixup arises because the axis
values are not checked before use, in which case IndexError is raised.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160905/b9b36827/attachment.html>


More information about the NumPy-Discussion mailing list