-
Notifications
You must be signed in to change notification settings - Fork 905
docs: update guide to mention GIL less #5381
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
Conversation
CodSpeed Performance ReportMerging #5381 will not alter performanceComparing Summary
Benchmarks breakdown
|
Icxolu
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 reworking this. I think our abstraction over GIL/free-threaded is coming together nicely. Just a couple of thoughts.
| Class objects can be used as arguments to `#[pyfunction]`s and `#[pymethods]` in the same way as the self parameters of instance methods, i.e. they can be passed as: | ||
| - `Py<T>` or `Bound<'py, T>` smart pointers to the class Python object, | ||
| - `&T` or `&mut T` references to the Rust data contained in the Python object, or | ||
| - `PyRef<T>` and `PyRefMut<T>` reference wrappers. |
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.
Should we also mention PyClassGuard here? Or do we wait with that until we deprecate PyRef eventually?
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 was wondering about it, I think it would be good to introduce PyClassGuard as part of 0.27 if we can figure out the way to sequence it in! I would prefer defer from this PR for the moment though.
Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
Following on from all the work we did in PyO3 0.26 to move API names to be less dependent on the GIL, this takes a first pass at documentation (particularly in the guide) to do similar.
There's probably more to do, however this is all I had time for today, and I figure it's probably easier for reviewers to have not too much of this in one go.