[Numpy-discussion] PyPy guys deserve some help on micronumpy from you, numpy gurus!
Mon Nov 21 05:26:49 CST 2011
On Fri, Sep 16, 2011 at 10:49 AM, Peter
> On Thu, Sep 15, 2011 at 11:34 AM, Peter
> <firstname.lastname@example.org> 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'
Good news, in PyPy 1.7 they have fixed the namespace clash.
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.
More information about the NumPy-Discussion