"""Missing value sentinel."""

from __future__ import annotations

import enum

from .typing_compat import override


# * Missing/no values ---------------------------------------------------------
# taken from https://github.com/python-attrs/attrs/blob/main/src/attr/_make.py
class _Missing(enum.Enum):
    """
    Sentinel to indicate the lack of a value when ``None`` is ambiguous.

    Use `cmomy.core.typing.MissingType` to type this value.
    """

    MISSING = enum.auto()

    @override
    def __repr__(self) -> str:
        return "MISSING"  # pragma: no cover

    def __bool__(self) -> bool:
        return False  # pragma: no cover


MISSING = _Missing.MISSING
"""
Sentinel to indicate the lack of a value when ``None`` is ambiguous.
"""
