Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonC-extension boundary / buffer protocolSingle-choice MCQ

Given the memoryview cast below, what are the resulting itemsize and contents?

mv = memoryview(bytearray(b'\x01\x00\x00\x00\x02\x00\x00\x00')) i = mv.cast('i') print(i.itemsize, list(i))