Skip to content

implement PyComplexMethods#3767

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
Icxolu:complex
Jan 27, 2024
Merged

implement PyComplexMethods#3767
davidhewitt merged 1 commit intoPyO3:mainfrom
Icxolu:complex

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.

@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
@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