The "Active Enum" Pattern
Briefly

The passive enum antipattern defies the purpose of enums by separating behavior from data, leading to maintenance challenges and complex code that complicates understanding.
When behavior is defined separately from enum members, it becomes hard to maintain inventory of usage, update consumers, and learn about the different usages as an API consumer.
With procedural definitions using if/elif or match, building tools for interrogation is hard, requiring parsing of the AST, making interaction cumbersome and confusing.
While transitioning from raw data types to enums is an improvement, stopping at passive enums introduces complexity that goes against their intended purpose.
Read at Glyph
[
|
]