[issue15944] memoryviews and ctypes

Stefan Krah report at bugs.python.org
Thu Aug 6 15:45:34 CEST 2015


Stefan Krah added the comment:

Yuriy: cast() does not do this.  What's requested is that e.g. a
single float is represented as a bytes object instead of a float.

Thus, you'd be able to do:

  m[0] = b'\x00\x00\x00\x01'

This has other implications, for example, two NaNs would compare
equal.  Hence the suggestion memoryview(raw=True).

----------

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


More information about the Python-bugs-list mailing list