Skip to content
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

feat(deps): upgrade pyo3 #325

Merged
merged 2 commits into from
Jan 22, 2025
Merged

feat(deps): upgrade pyo3 #325

merged 2 commits into from
Jan 22, 2025

Conversation

lukapeschke
Copy link
Collaborator

No description provided.

@lukapeschke lukapeschke added enhancement New feature or request ✋ need review ✋ dependencies Pull requests that update a dependency file 🦀 rust 🦀 Pull requests that edit Rust code labels Jan 17, 2025
@lukapeschke lukapeschke self-assigned this Jan 17, 2025
Copy link
Member

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good

@@ -42,11 +43,32 @@ impl FromPyObject<'_> for IdxOrName {
}
}

impl ToPyObject for IdxOrName {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you do

impl<'py, T> IntoPyObject<'py> for T where T: AsRef<IdxOrName>

to avoid this duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately not possible,as IdxOrName is not generic over T, which causes T to be considered a foreign type 😕

 impl<'py, T: AsRef<IdxOrName>> IntoPyObject<'py> for T {
           ^ type parameter `T` must be used as the type parameter for some local type

 note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
 note: only traits defined in the current crate can be implemented for a type parameter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah fk yes. The orphan rule striking again. LGTM then

@lukapeschke lukapeschke merged commit 0d4f087 into main Jan 22, 2025
23 checks passed
@lukapeschke lukapeschke deleted the bump-pyo3 branch January 22, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦀 rust 🦀 Pull requests that edit Rust code dependencies Pull requests that update a dependency file enhancement New feature or request ✋ need review ✋
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants