Stefan Krah <ste...@bytereef.org> added the comment:
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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35686> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com