
    g                          G d  d      Z y)c                   :    e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
y	)

Comparablea  Customise how your Enum acts when compared to other objects.

    Your Enum must implement a ``_cmp_values`` method which takes the Enum
    member's value and the other value and manipulates them into the actual
    values that can be compared.

    A case-insensitive StrEnum might look like this::

        class HttpHeader(Comparable, KebabCaseStrEnum):
            ContentType = auto()
            Host = auto()
            Accept = auto()
            XForwardedFor = auto()

            def _cmp_values(self, other):
                return self.value.lower(), str(other).lower()

    You could then use these headers in case-insensitive comparisons::

        assert "Content-Type" == HttpHeader.ContentType
        assert "content-type" == HttpHeader.ContentType
        assert "coNtEnt-tyPe" == HttpHeader.ContentType

    .. note::
        Your ``_cmp_values`` method *must not* return ``self`` as one of the
        values to be compared -- that would result in infinite recursion.
        Instead, perform operations on ``self.value`` and return that.

    .. warning::
        A bug in Python prior to 3.7.1 prevents mix-ins working with Enum
        subclasses.

    .. versionadded:: 0.4.6
    c                 4    | j                  |      \  }}||k(  S N_cmp_valuesselfothervalues      C/var/www/openai/venv/lib/python3.12/site-packages/strenum/mixins.py__eq__zComparable.__eq__%        ''.u~    c                 4    | j                  |      \  }}||k7  S r   r   r   s      r   __ne__zComparable.__ne__)   r   r   c                 4    | j                  |      \  }}||k  S r   r   r   s      r   __lt__zComparable.__lt__-        ''.uu}r   c                 4    | j                  |      \  }}||k  S r   r   r   s      r   __le__zComparable.__le__1   r   r   c                 4    | j                  |      \  }}||kD  S r   r   r   s      r   __gt__zComparable.__gt__5   r   r   c                 4    | j                  |      \  }}||k\  S r   r   r   s      r   __ge__zComparable.__ge__9   r   r   c                     t        d      )NzFEnum's using Comparable must implement their own _cmp_values function.)NotImplementedError)r	   r
   s     r   r   zComparable._cmp_values=   s    !T
 	
r   N)__name__
__module____qualname____doc__r   r   r   r   r   r   r    r   r   r   r      s+    !F
r   r   N)r   r!   r   r   <module>r"      s   ?
 ?
r   