[issue15944] memoryviews and ctypes

Martin Panter report at bugs.python.org
Thu Aug 6 18:50:23 CEST 2015


Martin Panter added the comment:

Here is a patch that allows any “C-contiguous” memoryview() to be cast to a byte view. Apart from the test that was explicitly checking that this wasn’t supported, the rest of the test suite still passes. I basically removed the check that was generating the “source format must be a native single character” error.

If two NANs are represented by the same byte sequence, I would expect their byte views to compare equal, which is the case with my patch.

----------
keywords: +patch
stage:  -> patch review
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file40139/cast-bytes.patch

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


More information about the Python-bugs-list mailing list