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

Remove usage of AsPyPointer in traits for convergint to PyObject #3391

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

alex
Copy link
Contributor

@alex alex commented Aug 16, 2023

Refs #3358

@alex
Copy link
Contributor Author

alex commented Aug 16, 2023

I'm not sure if a changelog is actually required here.

@alex
Copy link
Contributor Author

alex commented Aug 16, 2023

Pretty convinced it does not: Unless a user manually implements PyNativeType, all implementations will have both AsPyPointer and also AsRef<PyAny> (or be PyAny). Therefore, excluding that (unlikely) situation, this will not have any user visible impact.

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Personally I'd still prefer to see this documented. I think "Replace AsPyPointer with AsRef<PyAny> as a bound in the blanket implementation of From<&T> for PyObject" is enough.

@davidhewitt
Copy link
Member

davidhewitt commented Aug 16, 2023

Aside from that, I'm pretty certain this is the right solution to this one, nicely done 👍

I had wondered if we'd need to remove the blanket implementation and add concrete implementations in the macros in types/mod.rs, which would have been more breaking.

@alex
Copy link
Contributor Author

alex commented Aug 16, 2023

Okey doke. Done.

@davidhewitt
Copy link
Member

Thanks!

@davidhewitt davidhewitt added this pull request to the merge queue Aug 16, 2023
Merged via the queue into PyO3:main with commit 0375d57 Aug 16, 2023
31 checks passed
@alex alex deleted the drop-trait branch August 16, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants