This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hfingler
Recipients docs@python, hfingler
Date 2018-03-21.21:06:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In the documentation of asyncio.run_coroutine_threadsafe(coro, loop), in Section (, the example code does the following:

    future = asyncio.run_coroutine_threadsafe(coro, loop)
    # Wait for the result with an optional timeout argument
    assert future.result(timeout) == 3

 The problem is that the result method of a future, according to the documentation doesn't take parameters. It's in Section (

        Return the result this future represents.

 The same function is used in Section (

 This error is present in all Python 3.* docs.

 From the asyncio source code (, we have this in the Future class definition:

class Future:
    """This class is *almost* compatible with concurrent.futures.Future.
    - This class is not thread-safe.
    - result() and exception() do not take a timeout argument and
      raise an exception when the future isn't done yet.


So this example needs to be reworked, I'd do it if I knew more about asyncio. My ideas involve either using a add_done_callback with a flag or just busy waiting until future.done().
Date User Action Args
2018-03-21 21:06:46hfinglersetrecipients: + hfingler, docs@python
2018-03-21 21:06:46hfinglersetmessageid: <>
2018-03-21 21:06:46hfinglerlinkissue33117 messages
2018-03-21 21:06:46hfinglercreate