why doesn't an mmap.mmap object have some kind of memoryview method?

Cameron Simpson cs at cskk.id.au
Sun Aug 5 19:59:00 EDT 2018


On 05Aug2018 23:55, eryk sun <eryksun at gmail.com> wrote:
>On Sun, Aug 5, 2018 at 11:28 PM, Cameron Simpson <cs at cskk.id.au> wrote:
>> It seems obvious to me that a method returning a memoryview of the mapped
>> file would be very handy here: no data copies at all, and not even any I/O
>> unless the data are accessed. But I see no such method in the documentation.
>
>mmap objects support the buffer protocol. Pass the mmap object to
>built-in memoryview().

As I've just discovered not 30 seconds before seeing your post :-)

Thanks, this is what I'll be doing!

Cheers,
Cameron Simpson <cs at cskk.id.au>



More information about the Python-list mailing list