[issue5231] Change format of a memoryview

Antoine Pitrou report at bugs.python.org
Tue Aug 23 17:31:53 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> However, requiring an explicit two-step process for any other casting
> (i.e. take a 1-D view, then a shaped view of that flat 1-D view) also
> sounds reasonable.
> 
> So I agree with Victor that 1-D bytes -> any shape/format and any
> shape/format -> 1-D bytes should be allowed, but I think we should
> hold off on allowing arbitrary transformations in a single step.

Converting to 1-D bytes is my main motivation for this feature request,
so I'm fine with such a limitation.

The point is to be able to do in Python what we can do in C, take an
arbitrary buffer and handle it as pure bytes (for I/O or cryptography
purposes, for example).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5231>
_______________________________________


More information about the Python-bugs-list mailing list