Message 248134 - Python tracker (original) (raw)
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.