From: Victor Stinner Date: Sat, 11 Oct 2014 14:15:58 +0000 (+0200) Subject: asyncio doc: cleanup Hello World examples X-Git-Tag: v3.4.3rc1~505 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6888b96cee44364f5414b0e4dbfc69dba8b639b4;p=thirdparty%2FPython%2Fcpython.git asyncio doc: cleanup Hello World examples --- diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 8706b41ff470..ed385120805c 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -633,13 +633,16 @@ Handle Cancel the call. +Event loop examples +=================== .. _asyncio-hello-world-callback: -Example: Hello World (callback) -------------------------------- +Hello World with a callback +--------------------------- -Print ``Hello World`` every two seconds, using a callback:: +Print ``"Hello World"`` every two seconds using a callback scheduled by the +:meth:`BaseEventLoop.call_soon` method:: import asyncio @@ -656,7 +659,8 @@ Print ``Hello World`` every two seconds, using a callback:: .. seealso:: - :ref:`Hello World example using a coroutine `. + The :ref:`Hello World coroutine ` example + uses a :ref:`coroutine `. Example: Set signal handlers for SIGINT and SIGTERM diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index e7c316df9e92..8c4d790eace7 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -98,8 +98,9 @@ Print ``"Hello World"`` every two seconds using a coroutine:: .. seealso:: - :ref:`Hello World example using a callback `. - + The :ref:`Hello World with a callback ` + example uses a callback scheduled by the :meth:`BaseEventLoop.call_soon` + method. Example: Chain coroutines ^^^^^^^^^^^^^^^^^^^^^^^^^