[Python-ideas] Support parsing stream with `re`

Jonathan Fine jfine2358 at gmail.com
Sun Oct 7 13:13:22 EDT 2018


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


More information about the Python-ideas mailing list