[Numpy-discussion] Proposal: Deprecate np.int, np.float, etc.?

Chris Barker chris.barker at noaa.gov
Mon Jul 27 15:26:15 EDT 2015


On Sun, Jul 26, 2015 at 11:19 AM, Sturla Molden <sturla.molden at gmail.com>
wrote:

> > we get away with np.float, because every OS/compiler that gets any
> regular
> > use has np.float == a c double, which is always 64 bit.
>
> Not if we are passing an array of np.float to a ac routine that expects
> float*, e.g. in OpenGL, BLAS or LAPACK. That will for sure give crazy
> results, just hang, or segfault.
>

well, yes, it is confusing, but at least consistent. So if you use it once
correctly in your Python-C transition code, it should work the same way
everywhere. As opposed to a np.int which is a python int, which is (if I
have this right):

32 bits on all (most) 32 bit platforms
64 bits on 64 bit Linux and OS-X
32 bits on 64 bit Windows (also if compiled by cygwin??)

And who knows on a Cray or ARM, or???

Ouch!!!

Anyway -- we agree on this -- having the python types in the numpy
namespace is confusing and dangerous -- even if it will take forever to
deprecate them!

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20150727/8e8810df/attachment.html>


More information about the NumPy-Discussion mailing list