def _convertOther(self, other):
        """
        Check that a foreign object is suitable for use in the comparison or
        arithmetic magic methods of this L{SerialNumber} instance. Raise
        L{TypeError} if not.

        @param other: The foreign L{object} to be checked.
        @return: C{other} after compatibility checks and possible coercion.
        @raises: L{TypeError} if C{other} is not compatible.
        """
        if not isinstance(other, SerialNumber):
            raise TypeError(
                'cannot compare or combine %r and %r' % (self, other))

        if self._serialBits != other._serialBits:
            raise TypeError(
                'cannot compare or combine SerialNumber instances with '
                'different serialBits. %r and %r' % (self, other))

        return other

        Check that a foreign object is suitable for use in the comparison or
        arithmetic magic methods of this L{SerialNumber} instance. Raise
        L{TypeError} if not.

        @param other: The foreign L{object} to be checked.
        @return: C{other} after compatibility checks and possible coercion.
        @raises: L{TypeError} if C{other} is not compatible.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/_rfc1982.py