-
Notifications
You must be signed in to change notification settings - Fork 916
feat: raw pointer capsule instantiation method #5689
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?
Conversation
be6bd40 to
26e4220
Compare
davidhewitt
left a comment
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.
Thanks for working on this, I think the proposed functionality makes sense. Some initial comments on the design below.
|
Hi @lmmx (happy new year!), just checking when you would have some time to review @davidhewitt's comments? |
af57444 to
1a57d2d
Compare
HNY! 🪩 Addressed these threads in the large, a couple more to go I haven't marked resolved (patch the leak, take a decision on whether the name should be null) plus give the docstrings another pass. Right now I'm ensuring the CI checks are OK - I can see one is no longer a valid test because of the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
e22e4fd to
e02ee2b
Compare
|
I think that's addressed the comments so far, CI is passing, and I re-did the docstrings. Please feel free to update this PR if needed to merge it or give further review whenever suits. |
e02ee2b to
c633b75
Compare
|
Thank you very much @lmmx! I'm really impressed by your work, thank you for spending your time on this! |
Implements
PyCapsule::new_with_pointerandPyCapsule::new_with_pointer_and_destructoras described in the issue abovePurpose
Allows users to write much simpler code, without getting under the hood of
pyo3-ffito make apyo3::PyCapsuleEdit: original version using
*mut c_voidwas deprecatedClick to show original version
Update We now use the
std::ptr::NonNull<T>type (in which the T is a*mut T) so we can write it asNonNull<c_void>instead of*mut c_voidand then checkingptr.is_null().Usage would therefore be
instead of