79647770

Date: 2025-06-01 17:31:15
Score: 1
Natty:
Report link

No, it is impossible to safely and universally “delete” cyclic links from the Enum objects themselves without violating their performance and structure, because:

Enum objects and related methaclasses (Enumtype) by definition have complex and cyclic internal connections (see their Source Code).

Changing the Enum inlands on the fly is a bad idea: this will lead to bugs and unexpected behavior.

The best and correct path:

Serialize enum objects as lines (Myenum.value.name or Myenum.value.value) and in decering to restore them along these lines (see the examples below).

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: nkhalmatay