Enum with more explicit error message for missing values.
| 72 | |
| 73 | |
| 74 | class ExplicitEnum(Enum): |
| 75 | """ Enum with more explicit error message for missing values. |
| 76 | """ |
| 77 | |
| 78 | @classmethod |
| 79 | def _missing_(cls, value): |
| 80 | raise ValueError( |
| 81 | "%r is not a valid %s, please select one of %s" |
| 82 | % (value, cls.__name__, str(list(cls._value2member_map_.keys()))) |
| 83 | ) |
| 84 | |
| 85 | |
| 86 | class TruncationStrategy(ExplicitEnum): |
nothing calls this directly
no outgoing calls
no test coverage detected