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

Fix enum flag from cpp conversion #732

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Conversation

skallweitNV
Copy link
Contributor

@skallweitNV skallweitNV commented Sep 24, 2024

  • Use __str__ from the underlying flag factory class (allows printing flags like Flag.A|B|C)
  • Fix conversion from cpp -> python of enum flags that contain a combination of flags.

@skallweitNV
Copy link
Contributor Author

Hmm, looks like __str__ has changed in Python >= 3.11. It now returns numeric values for the Int variants.

Copy link
Owner

@wjakob wjakob left a comment

Choose a reason for hiding this comment

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

Could you add a testcase that checks the behavior of the flag __str__ routine?

@skallweitNV
Copy link
Contributor Author

@wjakob this should be good to merge now.

@wjakob wjakob merged commit 45ecf66 into wjakob:master Sep 26, 2024
31 checks passed
@wjakob
Copy link
Owner

wjakob commented Sep 26, 2024

Thank you @skallweitNV!

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