Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use buffer() in Python2 and use memoryview in Python3 #2242

Open
wants to merge 1 commit into
base: v0.6
Choose a base branch
from

Conversation

kashikoibumi
Copy link

This patch is a Python2-Python3 compatibility issue.

The builtin function buffer() in Python2 is renamed to memoryview() in Python3.
Although memoryview() is also defined in Python2, its behavior has subtle difference, so buffer() can not be simply replaced to memoryview().
Python seems not to be able to pass argument in reference in function parameter, so it is not able to define a function that choose the implementaton of buffer()/memoryview().
So branching by if statement seems to be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant