-
-
Notifications
You must be signed in to change notification settings - Fork 106
Update pyo3 to 0.25.1 #273
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
indygreg
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.
I didn't realize that this migration would be this simple!
If we change .unwrap() to ?, this diff seems reasonable to me.
Rebase it and let's get it merged!
rust-ext/src/buffers.rs
Outdated
|
|
||
| Ok(Self { | ||
| source: data.into_py(py), | ||
| source: data.into_py_any(py).unwrap(), |
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.
This should be .into_py_any(py)?
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.
fn into_py_any(self, py: Python<'py>)returns PyResult<Py<PyAny>>, which is defined as a Result type. Since the previous into_py returned a bare PyObject without any checks for the Err result, the unwrap() seems fine.
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.
Please use ? out of principle. The unwrap() forces people to reason about its existence which just adds to the maintenance burden.
indygreg
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.
This looks great to me!
Unless you have objections, I'll merge this once CI comes back clean.
No description provided.