[issue35686] BufferError with memory.release()
Eryk Sun
report at bugs.python.org
Tue Jan 8 19:27:58 EST 2019
Eryk Sun <eryksun at gmail.com> added the comment:
> Or, obviously:
>
> with open(fn, 'rb') as fd:
> with mmap.mmap(fd.fileno(), 0, access=mmap.ACCESS_READ) as mm:
> with memoryview(mm)[:2] as data:
> print(data)
Doesn't this rely on the immediate finalization of the unreferenced memoryview instance that creates the slice? It would be nice if memoryview supported alternate constructors memoryview(obj, stop) and memoryview(obj, start, stop[, step]).
----------
nosy: +eryksun
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35686>
_______________________________________
More information about the Python-bugs-list
mailing list