-
Notifications
You must be signed in to change notification settings - Fork 788
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
Add fn as_bytes to PyByteArray #632
Comments
maybe it would work to return |
However, if Python interpreters are allowed to move the backing buffer during a garbage collection (or similar), then returning any reference wouldn't be safe, unless the buffer was somehow pinned. Not sure if interpreters are allowed to do that. |
I think the bytearray can be resized at any point in python code just by using We can add This would allow @calixteman to do what they want via the |
👍 but I'm also for |
I understand the rational for to_vec (#373 (comment)) but in my use case it won't never happen (I just need to read data and nothing will modified them).
So it'd be nice to avoid a useless copy here.
The text was updated successfully, but these errors were encountered: