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

implement PyComplexMethods #3767

Merged
merged 1 commit into from
Jan 27, 2024
Merged

implement PyComplexMethods #3767

merged 1 commit into from
Jan 27, 2024

Conversation

Icxolu
Copy link
Contributor

@Icxolu Icxolu commented Jan 27, 2024

This ports PyComplex to the new Bound API from #3684.

Binary operator are implemented for different combinations of Bound, &Bound, as well as for Borrowed and GIL-refs. The inherent pow method is left with GIL-refs for backwards compatibility (I think its only callable from GIL-refs anyways?), the one on the trait uses the new API.

I think the magic __complex__ method can be changed together with other magic methods that currently return GIL-refs.

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.

Thank you very much for help with these implementations!

I think regarding __complex__, switching the return type to Bound hopefully already works with the traits we've got.

guide/src/class/numeric.md Outdated Show resolved Hide resolved
src/types/complex.rs Show resolved Hide resolved
src/types/complex.rs Show resolved Hide resolved
src/types/complex.rs Outdated Show resolved Hide resolved
@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Jan 27, 2024
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.

Great, this looks good to me, thanks very much again for the help here 👍

If you're interested in doing more and want ideas what to look into next, please do feel welcome to ping me on #3684!

@davidhewitt davidhewitt added this pull request to the merge queue Jan 27, 2024
Merged via the queue into PyO3:main with commit ed7263f Jan 27, 2024
37 of 38 checks passed
@Icxolu Icxolu deleted the complex branch January 27, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants