-
Notifications
You must be signed in to change notification settings - Fork 783
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
Bound 'py lifetime by GILPool in the internal usecases #869
Conversation
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 good to me, thanks for doing this! Got a few ideas how to simplify the code 😄
Should we add a |
@davidhewitt |
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 brilliant now! Thank you! I feel like the soundness holes in pyo3
are steadily closing 😄
/// | ||
/// # Safety | ||
/// The lifetime `'p` must be shorter than the period you *assume* that you have GIL. | ||
/// I.e., `Python<'static>` is always *really* unsafe. |
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.
👍 nice. Not sure the comma is necessary.
/// I.e., `Python<'static>` is always *really* unsafe. | |
/// I.e. `Python<'static>` is always *really* unsafe. |
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 didn't know but it looks a matter of Blitish/American English https://english.stackexchange.com/questions/6894/should-there-be-a-comma-after-i-e
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.
Heh that makes sense with me being British 😂
Co-Authored-By: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
Fixes #653.
By using
GILPool::py
instead ofPython::assume_gil_acquired
, we can inhivit&'static
reference as an argument.This PR also pushes some cleanups around
POOL
.