[pypy-dev] Looking into numpy ndarray.flags.writeable

Matti Picus matti.picus at gmail.com
Wed May 18 11:42:56 EDT 2016


On 18/05/16 08:43, Eli Stevens (Gmail) wrote:
> The following works on cpython, but fails on pypy:
>
>      import numpy as np
>      def test_writeable():
>          a = np.zeros((2,2), np.int8)
>>        a.flags.writeable = False
> E       TypeError: readonly attribute
>
> So I went and installed pypy's fork of numpy from source, and tried to
> start poking around looking for tests, etc. to see what was going on.
>
> It looks like numpy/core/tests/test_multiarray.py
> TestFlags.test_writeable is doing something similar, but when I
> attempt to run the tests like so:
>
> pypy -c "import numpy; numpy.test()"
>
> (Is that the right way to do it?)
>
> ...
Thanks for looking into this. It seems there are two seperate issues, 
the failure to set flag attributes and the failure to run tests.
Could you give a few more details about how to reproduce the second 
problem: which pypy and how did you obtain it, and how you 
built/installed numpy into it? What imports did you have to change?
You shouldn't have to change imports, but it is entirely possible that 
we have overlooked something.
Matti


More information about the pypy-dev mailing list