-
Notifications
You must be signed in to change notification settings - Fork 893
Add BytesWriter
#5517
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
base: main
Are you sure you want to change the base?
Add BytesWriter
#5517
Conversation
a016633 to
1593104
Compare
| } | ||
|
|
||
| if !(*writer).obj.is_null() { | ||
| if crate::_PyBytes_Resize(&mut (*writer).obj, size) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s a shame that _PyBytes_Resize is not available on the limited api. 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's viable to just use a Vec<u8> until calling .finish(). This might defeat the point of the API for users, but at the same time it would let us support it cleanly on all versions 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's viable to just use a
Vec<u8>until calling.finish(). This might defeat the point of the API for users, but at the same time it would let us support it cleanly on all versions 🤔
I was hesitant to fallback to Vec for the same reason. But it seems fine to do it like this to make it work.
517ced7 to
ddcc3f2
Compare
ddcc3f2 to
993eda8
Compare
de94a5a to
89a3e09
Compare
|
How can I make pyo3-ffi-check happy? It is complaining that |
Testing if we can add support for this before python 3.15.
closes #4003