[issue15944] memoryviews and ctypes

Martin Panter report at bugs.python.org
Fri Aug 7 03:55:16 CEST 2015


Martin Panter added the comment:

Assuming Issue 23756 is resolved and various standard library functions are meant to work with any C-contiguous buffer, then it makes sense to me for memoryview.cast("B") to work for any C-contiguous buffer. I also got the impression that David, Yuriy, and Eryksun all support this.

I don’t understand why you wouldn’t want this behaviour. It seems pointless just to maintain symmetry with being unable to cast back to “<d”. And casting from e.g. floating point to bytes to integers already disregards the original data type, so casting from unsupported types to bytes should be no worse.

----------

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


More information about the Python-bugs-list mailing list