diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2016-02-09 00:36:28 -0800 |
---|---|---|
committer | Nathaniel J. Smith <njs@pobox.com> | 2016-02-09 16:31:29 -0800 |
commit | 925473229f9594046dc5e5a38d93103edd57f41b (patch) | |
tree | 5580a1f3d1fbfc2debc0253c3437a22d67d37bbf /numpy/_import_tools.py | |
parent | 553137119d219d21229ec407b32d85e590d2a0c1 (diff) | |
download | numpy-925473229f9594046dc5e5a38d93103edd57f41b.tar.gz |
MAINT: Use PySlice_GetIndicesEx instead of custom reimplementation
This has the side effects of:
- changing several IndexError exceptions into TypeErrors
- allowing slices like `arr[False:True]` as equivalent to
`arr[0:1]` (because now we're using Python's logic for interpreting
slices, and Python is happy with treating bools as integers in integer
contexts).
It also deletes almost 100 lines of code :-).
While I was at it I also cleaned up some buggy uses of
PySlice_GetIndices (which is pretty broken -- e.g. the code was assuming
that it sets an exception on error, but this is not true! the Python
docs explicitly recommend that you never use it.)
Diffstat (limited to 'numpy/_import_tools.py')
0 files changed, 0 insertions, 0 deletions