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

A C extension fills a Py_buffer for an immutable bytes object via bf_getbuffer. What does the buffer's readonly flag end up being, and what does that mean for the consumer's bf_releasebuffer obligation?

b = bytes(4) mv = memoryview(b) mv[0] = 1 # ?