python-lzo icon indicating copy to clipboard operation
python-lzo copied to clipboard

Support Python Memory Views

Open lehanesa opened this issue 6 years ago • 2 comments

Python 3.8 introduces a new shared memory module for multiprocessing. The buffer is available as a python memory view.

Rather than copying the data to a new byte like object for decompression it would be great if we can pass the memory view directly. This would greatly improve the decompression when working with memory views. Currently it produces the error:

"argument 1 must be read-only bytes-like object, not memoryview"

lehanesa avatar Apr 22 '19 02:04 lehanesa

I would love to see a pull request to support this. However, at the moment it would also need to continue to support python 2.6, 2.7 and the 3.x back to 3.3.

jd-boyd avatar Apr 22 '19 03:04 jd-boyd

I got

TypeError: argument 1 must be read-only bytes-like object, not bytearray

I use bytearray because I've to serialize some data structure at runtime.

Some packages have dropped python 2.7 support in new release. Ubuntu 20.04 have removed python2. And some linux distribution have linked python command to /usr/bin/python3. It's time to say goodbye to python2.

keelung-yang avatar Sep 11 '20 03:09 keelung-yang