Source code for archiver_test.details
from __future__ import annotations
from enum import Enum
[docs]
class Detail(str, Enum):
"""Enum of detail types present in the archiver per PV"""
# Allows sorting
[docs]
def __lt__(self, other: str) -> bool:
"""Compares two Detail enums by < so sorting works."""
if self == other:
return False
# the following works because the order of elements in the definition
# is preserved
for elem in Detail:
if self == elem:
return True
elif other == elem:
return False
msg = "Bug: we should never arrive here"
raise RuntimeError(msg) # I just like being pedantic