def __cmp__(self, other):
        """
        Define L{Headers} instances as being equal to each other if they have
        the same raw headers.
        """
        if isinstance(other, Headers):
            return cmp(
                sorted(self._rawHeaders.items()),
                sorted(other._rawHeaders.items()))
        return NotImplemented

        Define L{Headers} instances as being equal to each other if they have
        the same raw headers.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http_headers.py