def __lt__(self, other):
        """
        Allow I{less than} comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
        """
        other = self._convertOther(other)
        return (
            (self._number < other._number
             and (other._number - self._number) < self._halfRing)
            or
            (self._number > other._number
             and (self._number - other._number) > self._halfRing)
        )

        Allow I{less than} comparison with another L{SerialNumber} instance.

        @type other: L{SerialNumber}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/_rfc1982.py