summaryrefslogtreecommitdiff
path: root/numpy/core/arrayprint.py
diff options
context:
space:
mode:
authorThouis (Ray) Jones <thouis@gmail.com>2012-06-06 10:32:35 +0200
committerThouis (Ray) Jones <thouis@gmail.com>2012-06-06 11:22:45 +0200
commit56f865980447b2fc5475b1b71ef7347383660782 (patch)
treee3a41654332f891192d8c003026073616b247452 /numpy/core/arrayprint.py
parent4c68a33a5b75cbfed1aa0b3b23e947563b9a513a (diff)
downloadnumpy-56f865980447b2fc5475b1b71ef7347383660782.tar.gz
Add check_and_adjust_index(), and replace most index checks with it.
This commit adds a check_and_adjust_index(npy_intp *index, npy_intp max, int axis) function which checks index against max, setting an IndexError and returning -1 if it's not valid, and otherwise adjusting index in-place to handle Python's negative indexing, and returning 0. It also changes most places in the code where indexes were being checked and adjusted with a call to this function.
Diffstat (limited to 'numpy/core/arrayprint.py')
0 files changed, 0 insertions, 0 deletions