Enums make good singletons

It's simple and common to allocate a marker object to represent missing or null data. MISSING = object() There's a slightly more verbose construct with some advantages: import enum class MissingType(enum.Enum): MISSING = "MISSING" MISSING = MissingEnum.MISSING Type checkers understand that MISSING is the only possible value of MissingType; so you can use is checks: def or_1(val: float |…