This commit is contained in:
Guido van Rossum 2013-05-21 08:34:55 -07:00
parent 023010c742
commit 8acf02f633
1 changed files with 8 additions and 3 deletions

View File

@ -260,8 +260,7 @@ methods, and still conform to the other methods.)
- Basic callbacks: ``call_soon()``, ``call_later()``, ``call_at()``.
- Thread interaction: ``call_soon_threadsafe()``,
``wrap_future()``, ``run_in_executor()``,
``set_default_executor()``.
``run_in_executor()``, ``set_default_executor()``.
- Internet name lookups: ``getaddrinfo()``, ``getnameinfo()``.
@ -903,7 +902,13 @@ However the current PEP strives to have no dependencies beyond Python
3.3, so changes to ``concurrent.futures.Future`` are off the table for
now.
There is one public function related to Futures. It is:
There are some public functions related to Futures:
- ``async(arg)``. This takes an argument that is either a coroutine
object or a Future (i.e., anything you can use with ``yield from``)
and returns a Future. If the argument is a Future, it is returned
unchanged; if it is a coroutine object, it wraps it in a Task
(remember that ``Task`` is a subclass of ``Future``).
- ``wrap_future(future)``. This takes a PEP 3148 Future (i.e., an
instance of ``concurrent.futures.Future``) and returns a Future