-
Notifications
You must be signed in to change notification settings - Fork 779
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
PyCFunction bound api #3800
PyCFunction bound api #3800
Conversation
2acb33d
to
721c921
Compare
CodSpeed Performance ReportMerging #3800 will degrade performances by 15.02%Comparing Summary
Benchmarks breakdown
|
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, overall looks good to me! Just two small style requests...
Regarding wrap_pyfunction
, I'm definitely open to trying to see what happens if we change it to return Bound<'py, PyCFunction>
. I think that we would potentially need to change both PyModule::add_function
and PyModuleMethods::add_function
to just take Bound<'py, PyCFunction>
.
That's breaking, but hopefully most users would never notice the change if they're using the standard pattern. We'd need to mention this in the migration guide where we also comment on how we made the same decision to change the return type of the intern!
macro.
Definitely worth experimenting in its own PR, though.
Yup changes look pretty minimal. I'll open the PR once this gets merged. BTW do you prefer for me to squash my commits when resolving PR comments so history ends up being a bit cleaner? |
Yes please! Sometimes it makes sense to arrange things into multiple commits for future readers and that's fine, but when they're just "review feedback" then we like squashing 👍 (Because we occasionally keep multiple commits GH merge queue doesn't let us squash automatically. But maybe we should consider changing this, and instead of we want multiple commits open multiple PRs 🤔) |
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.
Looks great, thanks again 👍
840168b
to
aa3c938
Compare
Squashed |
Part of #3684
Adds
_bound
versions ofPyCFunction
constructors.@davidhewitt Any suggestions what to do with
wrap_pyfunction
? The change to update it to Bound is pretty minimal, but potentially breaking if people are using it outside the standardm.add_function(wrap_pyfunction!...)
scenario