[Numpy-discussion] Non-Integer deprecations

Sebastian Berg sebastian@sipsolutions....
Fri Apr 12 11:55:30 CDT 2013


Hey all,

just revisiting non-integer (index) deprecations (basically
https://github.com/numpy/numpy/pull/2891). I believe for all natural
integer arguments, it is correct to do a deprecation if the input is not
an integer. (Technically most of these go through PyArray_PyIntAsIntp,
and if not probably should)

This affects all axes, shapes, strides, indices (as well as slices) and
(in the future) possibly other integer arguments. Indexing already has a
deprecation warning in master, but I think it should be moved further
down into PyArray_PyIntAsIntp.

Just a couple of minor things to note or I am wondering about:
  1. Does anyone see a problem with rejecting python bools as not
     integers? Python does not do it, but for array indices they
     misbehave and I don't see a real reason to allow them even
     for other integer arguments.
  2. This will mean that 1e4, etc. is not valid, 10**4 must be used.
  3. Deprecate (maybe faster then the rest) that array.__index__()
     works for non 0-d arrays seems right, but makes me a bit wonder
     about __int__ and __float__. (This is unrelated though)
  4. This will affect third party behavior using the public numpy
     conversion functions.

These are long deprecations (but possibly the __index__ which I think
already has a bug report as being wrong...) so if any problems occur
there should be time to clear them. This is just a note in case someone
sees any problems with the general plan.

Regards,

Sebastian



More information about the NumPy-Discussion mailing list