Use buffer() in Python2 and use memoryview in Python3 #2242
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-19#2242
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "kashikoibumi/memoryview"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.