-
Notifications
You must be signed in to change notification settings - Fork 9
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
Bump to 0.23 #21
Bump to 0.23 #21
Conversation
I tried two slightly different approaches that both hit small snags. It seems like we need some bound on the |
I noticed PyO3/pyo3#4708, which helped me fix compilation here without needing to add another generic. |
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 helping with the migration!
I have some comments on the IntoPyObject
migration. The majority of the bounds introduced here are stricter then necessary. The higher ranked bound (for<'py> ...
) means the bound must hold for any arbitrary lifetime. But most of the time you already have a specific 'py
lifetime as an input via the Python<'py>
token, a Bound<'py, T>
or a Borrowed<'_, 'py, T>
. In these case it is only necessary to restrict the bound to that specific lifetime instead of all possible lifetimes.
The higher ranked bound is needed when you don't have any input that brings a 'py
lifetime. In these cases the Python<'py>
token is usually created via Python::with_gil
which can have any arbitrary lifetime.
I hope this clears it a bit up and maybe solves the compile errors you were running into.
(PyO3/pyo3#4708 should help with boilerplate, but everything should be possible to implement in the mean time without it)
@Icxolu I tried to move to the
like you said here. But then when I switch just those two functions in
So it seems that the higher-ranked |
Ooops, I guess I spoke to soon then, sorry about that 🙈. On closer look |
944cbc8
to
679a4c6
Compare
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 this seems to be going in the right direction; looks like the pytests
directory needs a bit of love too.
Tests seem to be passing locally now |
I'm not sure why the coverage CI is erroring. It seems to be erroring before even getting a result? |
I think |
Looks like this is all green, thanks for the help! |
Change list
IntoPyObject
trait, with a couple compilation errors still that I'm not sure how to fix._bound
suffix