PY-ENUM0002 · parallel_enum_metadata
Detect static string dictionaries that mirror one enum.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”A parallel metadata dictionary has at least two entries, uses members of one locally defined enum as every key, and uses string literals as every value. The enum can own these descriptions directly and generate the dictionary when an API needs one.
Evidence
Section titled “Evidence”Every finding identifies one parallel dictionary expression and its enum class.
Exceptions
Section titled “Exceptions”Dynamic handler registries, non-string values, partial runtime overrides, and mappings across several enum types remain separate data structures.
Examples
Section titled “Examples”{Intent.TODO: "Future work", Intent.WHY: "Rationale"} mirrors static enum
descriptions. {Intent.TODO: handle_todo} remains a behavior registry.
References
Section titled “References”- Cites “Refactoring”, Parallel Inheritance Hierarchies