Skip to content

Conversation

@reversefold
Copy link

@reversefold reversefold commented Dec 2, 2025

Fixes #699. The values of an Enum are unstructured and structured. Structuring is only done when the Enum class has a type defined for the _value_ attribute as per the Python typing standard.

I've added two very simple tests which show that this works. I'm attempting to add tests which use hypothesis like the rest but the magic chains of incantations in tests/typed.py are throwing me a bit and it's taking a while to understand what they're doing and how to use it to generate random dynamic Enum classes. Any pointers there would be appreciated.

@Tinche
Copy link
Member

Tinche commented Dec 2, 2025

Thanks for working on this, I will review within a couple days when I get some time. Don't worry about Hypothesis, I'm kind of moving away from it, since it bloats the test times and can turn out to be very complex to use properly, so the cost/benefit ratio is usually in favor of just normal unit tests. :)

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.

The value of enums should be unstructured and structured too

2 participants