Message333268
> 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]). |
|
Date |
User |
Action |
Args |
2019-01-09 00:27:59 | eryksun | set | recipients:
+ eryksun, skrah, Thomas.Waldmann, xtreak |
2019-01-09 00:27:57 | eryksun | set | messageid: <1546993678.0.0.555594897036.issue35686@roundup.psfhosted.org> |
2019-01-09 00:27:57 | eryksun | link | issue35686 messages |
2019-01-09 00:27:57 | eryksun | create | |
|