Mar-07-2019, 07:12 AM
First of all - why memoryview? From documentation:
'withoug copying' means that main advantage of memoryview is with large binary data. Instead of copying one can have memoryview object.
One additional tidbit from documentation about memoryview and release:
Regarding complex numbers - what do you want to accomplish? Bytes and bytearray objects contain single bytes (bytes is immutable and bytearray is a mutable sequence)
Quote:memoryview objects allow Python code to access the internal data of an object that supports the buffer protocol without copying.
'withoug copying' means that main advantage of memoryview is with large binary data. Instead of copying one can have memoryview object.
One additional tidbit from documentation about memoryview and release:
Quote:Many objects take special actions when a view is held on them (for example, a bytearray would temporarily forbid resizing); therefore, calling release() is handy to remove these restrictions (and free any dangling resources) as soon as possible.
Regarding complex numbers - what do you want to accomplish? Bytes and bytearray objects contain single bytes (bytes is immutable and bytearray is a mutable sequence)
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.