summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-08-06 20:22:43 -0400
committerChris McDonough <chrism@plope.com>2011-08-06 20:22:43 -0400
commit8d1533d95ceebbef641a220236b77d9b3931cc31 (patch)
tree4a5d0d77a7796bee541544bbebeb2214ca9cd9a9 /docs
parent479db008942048e29041e7225b8f60b17e843f07 (diff)
downloadpyramid-8d1533d95ceebbef641a220236b77d9b3931cc31.tar.gz
pyramid-8d1533d95ceebbef641a220236b77d9b3931cc31.tar.bz2
pyramid-8d1533d95ceebbef641a220236b77d9b3931cc31.zip
change return value of tween to just response
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/hooks.rst7
1 files changed, 3 insertions, 4 deletions
diff --git a/docs/narr/hooks.rst b/docs/narr/hooks.rst
index 7290876e6..c6438dfdf 100644
--- a/docs/narr/hooks.rst
+++ b/docs/narr/hooks.rst
@@ -855,8 +855,7 @@ will be the Pyramid :term:`application registry` represented by this
Configurator. A tween factory must return a tween when it is called.
A tween is a callable which accepts a :term:`request` object and returns a
-two-tuple consisting of a :term:`request` object and a :term:`response`
-object.
+two-tuple a :term:`response` object.
Once you've created a tween factory, you can register it using the
:meth:`pyramid.config.Configurator.add_tween` method.
@@ -878,12 +877,12 @@ Here's an example creating a tween factory and registering it:
def timing_tween(request):
start = time.time()
try:
- request, response = handler(request)
+ response = handler(request)
finally:
end = time.time()
log.debug('The request took %s seconds' %
(end - start))
- return request, response
+ return response
return timing_tween
# if timing support is not enabled, return the original
# handler