We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 378edc6 commit 9086469Copy full SHA for 9086469
1 file changed
test/test_memoryview.py
@@ -97,3 +97,15 @@ def test_multidim_memoryview():
97
data = view.cast(view.format, (3, 2))
98
packed = packb(data)
99
assert packed == b"\xc4\x06\x00\x00\x00\x00\x00\x00"
100
+
101
102
+def test_unpack_noncontiguous_memoryview():
103
+ # Use a multi-byte value so the padded stride-2 view is non-contiguous.
104
+ packed = packb(2**32)
105
+ padded = bytearray()
106
+ for byte in packed:
107
+ padded.append(byte)
108
+ padded.append(0)
109
+ noncont = memoryview(bytes(padded))[::2]
110
+ assert not noncont.c_contiguous
111
+ assert unpackb(noncont) == 2**32
0 commit comments