Anders wrote

> An mmap object is one of the things you can make a memoryview of,
> although looking again, it seems you don't even need to, you can
> just re.search the mmap object directly.
>
> re.search'ing the mmap object means the operating system takes care of
> the streaming for you, reading in parts of the file only as necessary.

Provided mmap releases memory when possible, this is a good solution,
and probably in many cases better than the one I suggested. And closer
to what the original poster asked for.

So I've learnt something. Thank you all.

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to