From: Ben Darnell Date: Wed, 12 Jun 2013 02:11:49 +0000 (-0400) Subject: Doc updates from Zhigang Wang X-Git-Tag: v3.1.0~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6161d0f9e4065b92dd225e1810da3815453cd971;p=thirdparty%2Ftornado.git Doc updates from Zhigang Wang --- diff --git a/tornado/gen.py b/tornado/gen.py index cbff9ff6e..92b7458ed 100644 --- a/tornado/gen.py +++ b/tornado/gen.py @@ -19,7 +19,6 @@ For example, the following asynchronous handler:: could be written with ``gen`` as:: class GenAsyncHandler(RequestHandler): - @asynchronous @gen.coroutine def get(self): http_client = AsyncHTTPClient() @@ -166,13 +165,7 @@ def coroutine(func): """Decorator for asynchronous generators. Any generator that yields objects from this module must be wrapped - in either this decorator or `engine`. These decorators only work - on functions that are already asynchronous. For - `~tornado.web.RequestHandler` :ref:`HTTP verb methods ` methods, this - means that both the `tornado.web.asynchronous` and - `tornado.gen.coroutine` decorators must be used (for proper - exception handling, ``asynchronous`` should come before - ``gen.coroutine``). + in either this decorator or `engine`. Coroutines may "return" by raising the special exception `Return(value) `. In Python 3.3+, it is also possible for