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

rework complex enum field conversion #4694

Merged
merged 2 commits into from
Nov 10, 2024
Merged

rework complex enum field conversion #4694

merged 2 commits into from
Nov 10, 2024

Conversation

Icxolu
Copy link
Contributor

@Icxolu Icxolu commented Nov 10, 2024

This reworks the complex enum field conversion to use IntoPyObject either by reference if available, or together with Clone if not.

I think in the future we should probably rework complex enums to make them use of the same infrastructure we already have for #[pyo3(get)].

Closes #4216
Xref #4651

@Icxolu Icxolu added the bugfix label Nov 10, 2024
@Icxolu Icxolu mentioned this pull request Nov 10, 2024
5 tasks
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.

Thanks! Agreed this could use a refactor, probably that's easier after we remove ToPyObject and other backwards-compatibility arms from the #[pyo3(get)] code.

@davidhewitt davidhewitt added this pull request to the merge queue Nov 10, 2024
Merged via the queue into PyO3:main with commit be4407c Nov 10, 2024
45 of 46 checks passed
@Icxolu Icxolu deleted the fix/4216 branch November 10, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants