Memoryview data type

6 views
Skip to first unread message

Malik Jahanzeb

unread,
Oct 25, 2021, 12:57:32 AM10/25/21
to Py4J Support and Comments
Hi,

It seems Python 3.8> use memoryview type objects to represent bytes/bytearray for efficient access. 

The code I had that used py4j worked with python 3.7 but got broken with 3.8 because apparently py4j does not expect memoryview type objects. I am currently using a workaround in py4j/compat.py as follows:

Change:
    def isbytearray(s):
        return isinstance(s, bytearray)
To:
    def isbytearray(s):
        return isinstance(s, bytearray) or isinstance(s, memoryview)

Is there a plan to add this support?

Thanks and best regards,
Malik

Dror Brill

unread,
Nov 1, 2021, 11:33:24 AM11/1/21
to Py4J Support and Comments, malikja...@gmail.com
Hello,
I would like to join in on this request.
We are trying to incorporate Py4J in an enterprise product, but our users have a hard request for supporting latest Python versions.
Would it be possible to support Python versions newer than 3.7?

Thank you and we really appreciate the great work that has been done on the Py4J project,
Dror

ב-יום שני, 25 באוקטובר 2021 בשעה 00:57:32 UTC-4, malikja...@gmail.com כתב/ה:
Reply all
Reply to author
Forward
0 new messages