Antoine Pitrou <pit...@free.fr> added the comment:

Well, in the mmap case, this is trivially fixed by writing:
```
with open("my_data.pkl", "r+b") as f_in:
    mm = mmap.mmap(f_in.fileno(), 0)

print(pickle.loads(memoryview(mm)))
```

It will also be faster this way, since the pickle will be read directly from 
memory instead of going through read() calls.

This makes me think that perhaps this issue isn't as bad: it forces people to 
abandon bad idioms :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39681>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to