Good practice is to make sure you understand what memoryview is. Best place to start is Python official documentation (class memoryview(obj))
So we need bytes or bytarray (or have our own class).
Maybe following will give general idea:
Quote:Create a memoryview that references obj. obj must support the buffer protocol. Built-in objects that support the buffer protocol include bytes and bytearray.
So we need bytes or bytarray (or have our own class).
Maybe following will give general idea:
>>> m = memoryview(b'[1, 2, 3]') >>> list(m) [91, 49, 44, 32, 50, 44, 32, 51, 93] >>> for el in m: ... print(chr(el)) ... [ 1 , 2 , 3 ] >>> type(m) memoryview
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.