'When an object of type (or interface) ``type_or_iface`` is
returned from a view callable, Pyramid will use the adapter
``adapter`` to convert it into an object which implements the
:class:`pyramid.interfaces.IResponse` interface.  If ``adapter`` is
None, an object returned of type (or interface) ``type_or_iface``
will itself be used as a response object.
``adapter`` and ``type_or_interface`` may be Python objects or
strings representing dotted names to importable Python global
objects.
See :ref:`using_iresponse` for more information.'

@action_method
def add_response_adapter(self, adapter, type_or_iface):

    adapter = self.maybe_dotted(adapter)
    type_or_iface = self.maybe_dotted(type_or_iface)
    def register():
        reg = self.registry
        if (adapter is None):
            reg.registerSelfAdapter((type_or_iface,), IResponse)
        else:
            reg.registerAdapter(adapter, (type_or_iface,), IResponse)
    discriminator = (IResponse, type_or_iface)
    intr = self.introspectable('response    adapters', discriminator, self.object_description(adapter), 'response    adapter')
    intr['adapter'] = adapter
    intr['type'] = type_or_iface
    self.action(discriminator, register, introspectables=(intr,))
