@djangoproject · Post #342 · 05/27/2017, 05:20 PM
https://docs.python.org/3.6/library/mmap.html #Memory-mapped file objects behave like both #bytearray and like #file_objects. You can use mmap objects in most places where bytearray are expected; for example, you can use the re module to search through a memory-mapped file. #mmap