def startResponse(self, status, headers, excInfo=None):
        """
        The WSGI I{start_response} callable.  The given values are saved until
        they are needed to generate the response.

        This will be called in a non-I/O thread.
        """
        if self.started and excInfo is not None:
            reraise(excInfo[1], excInfo[2])

        # PEP-3333 mandates that status should be a native string. In practice
        # this is mandated by Twisted's HTTP implementation too, so we enforce
        # on both Python 2 and Python 3.
        if not isinstance(status, str):
            raise TypeError(
                "status must be str, not %r (%s)"
                % (status, type(status).__name__))

        # PEP-3333 mandates that headers should be a plain list, but in
        # practice we work with any sequence type and only warn when it's not
        # a plain list.
        if isinstance(headers, list):
            pass  # This is okay.
        elif isinstance(headers, Sequence):
            warn("headers should be a list, not %r (%s)" % (
                headers, type(headers).__name__), category=RuntimeWarning)
        else:
            raise TypeError(
                "headers must be a list, not %r (%s)"
                % (headers, type(headers).__name__))

        # PEP-3333 mandates that each header should be a (str, str) tuple, but
        # in practice we work with any sequence type and only warn when it's
        # not a plain list.
        for header in headers:
            if isinstance(header, tuple):
                pass  # This is okay.
            elif isinstance(header, Sequence):
                warn("header should be a (str, str) tuple, not %r (%s)" % (
                    header, type(header).__name__), category=RuntimeWarning)
            else:
                raise TypeError(
                    "header must be a (str, str) tuple, not %r (%s)"
                    % (header, type(header).__name__))

            # However, the sequence MUST contain only 2 elements.
            if len(header) != 2:
                raise TypeError(
                    "header must be a (str, str) tuple, not %r"
                    % (header, ))

            # Both elements MUST be native strings. Non-native strings will be
            # rejected by the underlying HTTP machinery in any case, but we
            # reject them here in order to provide a more informative error.
            for elem in header:
                if not isinstance(elem, str):
                    raise TypeError(
                        "header must be (str, str) tuple, not %r"
                        % (header, ))

        self.status = status
        self.headers = headers
        return self.write

        The WSGI I{start_response} callable.  The given values are saved until
        they are needed to generate the response.

        This will be called in a non-I/O thread.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/wsgi.py