79647883

Date: 2025-06-01 20:03:55
Score: 1.5
Natty:
Report link

What about this?

This allows me to continue using `Enum`, but forces me to check whether the object I'm serializing has a `_to_db` method.

class MyEnum(Enum):
    VALUE = auto()

    def _to_db(self) -> Self:
        return self.value
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Starts with a question (0.5): What
Posted by: suizokukan