Michael Merickel
2016-11-19 8f6d45153caf82b9de732f6d6ec333bad899f1d0
improve view decorator return type documentation

Fixes #2770.
2 files modified
16 ■■■■■ changed files
docs/narr/viewconfig.rst 8 ●●●●● patch | view | raw | blame | history
pyramid/config/views.py 8 ●●●●● patch | view | raw | blame | history
docs/narr/viewconfig.rst
@@ -252,7 +252,7 @@
    def myview(request):
      ...
  Is similar to doing::
  Is similar to decorating the view callable directly::
    @view_config(...)
    @decorator2
@@ -260,8 +260,10 @@
    def myview(request):
      ...
  All view callables in the decorator chain must return a response object
  implementing :class:`pyramid.interfaces.IResponse` or raise an exception:
  An important distinction is that each decorator will receive a response
  object implementing :class:`pyramid.interfaces.IResponse` instead of the
  raw value returned from the view callable. All decorators in the chain must
  return a response object or raise an exception:
  .. code-block:: python
pyramid/config/views.py
@@ -444,9 +444,11 @@
          think about preserving function attributes such as ``__name__`` and
          ``__module__`` within decorator logic).
          All view callables in the decorator chain must return a response
          object implementing :class:`pyramid.interfaces.IResponse` or raise
          an exception:
          An important distinction is that each decorator will receive a
          response object implementing :class:`pyramid.interfaces.IResponse`
          instead of the raw value returned from the view callable. All
          decorators in the chain must return a response object or raise an
          exception:
          .. code-block:: python