Merged
Conversation
8bef883 to
cb65379
Compare
CodSpeed Performance ReportMerging #3826 will degrade performances by 11.36%Comparing Summary
Benchmarks breakdown
|
This was referenced Feb 11, 2024
Merged
cb65379 to
fb9af02
Compare
davidhewitt
reviewed
Feb 11, 2024
Member
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks again! Got a few suggestions for this one...
src/err/mod.rs
Outdated
| )] | ||
| #[inline] | ||
| pub fn is_instance(&self, py: Python<'_>, ty: &PyAny) -> bool { | ||
| self.is_instance_bound(py, ty.into_py(py).into_bound(py)) |
Member
There was a problem hiding this comment.
With &Bound for the argument, this should work:
Suggested change
| self.is_instance_bound(py, ty.into_py(py).into_bound(py)) | |
| self.is_instance_bound(py, &ty.as_borrowed()) |
Potentially are you willing to open a PR to recommend using as_borrowed() as the way to go from &PyAny to &Bound in the migration guide? e.g.
let gil_ref: &PyAny = ...;
let bound: &Bound<PyAny> = &gil_ref.as_borrowed();(hopefully most user code won't need to care about this because all of it will just get migrated over, but this might still be useful for users to be aware as they rewrite their code...)
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements more of the
Boundapi from #3684.