New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ndarray does not accept memoryview for buffer= under python2 #5935
Comments
IIRC, we decided not to support memoryview in Python 2 because it was only available for 2.7. However, it has been backported to 2.6 and we no longer support earlier versions, so we should probably revisit that decision. |
Yes. Please note it is already supported on Python 2 - array() accepts memoryview ([8-12] above). Only ndarray constructor does not accept memoryview for buffer= argument. |
Because numpy.ndarray does not accept it as buffer= argument numpy/numpy#5935 and our memcpy crashes. NOTE if we'll need to use memoryview, we can adapt our memcpy to use array() directly which works with memoryview, as outlined in the above numpy issue.
We'd love to have better support for memoryview as well |
Closing this, Python 2.x only issues are no longer relevant given that we're dropping support for 2.7 soon. |
Hello up there.
I've discovered that
ndarray(buffer=memoryview)
fails on python 2:Creating ndarray backed by memoryview fails:
though it succeeds if we pass memoryview to array():
[7] works on python 3, of course.
Thanks beforehand,
Kirill
The text was updated successfully, but these errors were encountered: