'The object passed as ``factory`` should be an object (or a
:term:`dotted Python name` which refers to an object) which
will be used by the :app:`Pyramid` router to create all
request objects.  This factory object must have the same
methods and attributes as the
:class:`pyramid.request.Request` class (particularly
``__call__``, and ``blank``).
See :meth:`pyramid.config.Configurator.add_request_method`
for a less intrusive way to extend the request objects with
custom methods and properties.
.. note::
Using the ``request_factory`` argument to the
:class:`pyramid.config.Configurator` constructor
can be used to achieve the same purpose.'

@action_method
def set_request_factory(self, factory):

    factory = self.maybe_dotted(factory)
    def register():
        self.registry.registerUtility(factory, IRequestFactory)
    intr = self.introspectable('request    factory', None, self.object_description(factory), 'request    factory')
    intr['factory'] = factory
    self.action(IRequestFactory, register, introspectables=(intr,))
