[Numpy-discussion] PyPy guys deserve some help on micronumpy from you, numpy gurus!

Peter numpy-discussion at maubp.freeserve.co.uk
Mon Nov 21 06:26:49 EST 2011


On Fri, Sep 16, 2011 at 10:49 AM, Peter
<numpy-discussion at maubp.freeserve.co.uk> wrote:
> On Thu, Sep 15, 2011 at 11:34 AM, Peter
> <numpy-discussion at maubp.freeserve.co.uk> wrote:
>> This may not be the best place to ask, but how should a
>> python script (e.g. setup.py) distinguish between real NumPy
>> and micronumpy? Or should I instead be looking to distinguish
>> PyPy versus another Python implementation?
>
> For anyone interested, over on the pypy-dev list Alex recommended:
> import platform; platform.python_implementation == 'PyPy'
> http://mail.python.org/pipermail/pypy-dev/2011-September/008315.html

Good news, in PyPy 1.7 they have fixed the namespace clash.
http://morepypy.blogspot.com/2011/11/pypy-17-widening-sweet-spot.html

In PyPy 1.6, "import numpy as np" would give you "fake" numpy,
the micronumpy written by the PyPy team - which was a frustratingly
limited subset of the full NumPy API.

As of PyPy 1.7, you must explicitly use "import numpypy as np" to
get their micronumpy. This makes life simpler for 3rd party libraries
since "import numpy" will just fail, and they can use and test for
the PyPy mini-numpy explicitly if they want to.

Cheers,

Peter



More information about the NumPy-Discussion mailing list