Stefan Krah added the comment:
Ok, I think the main reason for disallowing zeros in view->shape here
was that casts are undefined if also the "shape" argument is given:
x = memoryview(b'')
x.cast('d', shape=[1])
Now, this case *is* already caught at a later stage, since there isn't
enough space for the cast. Nevertheless, the code is tricky, so I'd
prefer to be conservative and catch shape arguments earlier.
I left a suggestion in Rietveld. I would commit it myself, but I'm
moving and my infrastructure is a mess. It would be great if one
of you could take this one.
I'll try to review the general case for ndim > 1 later, but that's
not particularly important right now.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com