classification
Title: Change asyncio.async() → ensure_future()
Type: Stage: resolved
Components: asyncio, Documentation Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, gvanrossum, martin.panter, python-dev, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2015-06-22 14:24 by martin.panter, last changed 2015-07-01 02:38 by yselivanov. This issue is now closed.

Files
File name Uploaded Description Edit
ensure_future.patch martin.panter, 2015-06-22 14:24 review
Messages (6)
msg245631 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-06-22 14:24
The async() function is marked as deprecated in 3.4.4. This patch replaces most references to it with references to ensure_future(). The exception is <https://docs.python.org/3.4/library/asyncio-eventloop.html#asyncio.BaseEventLoop.create_task>, which suggests using it in Python < 3.4.2.
msg245633 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-06-22 14:56
Martin, I believe this was done as part of issue24180, see this commit https://hg.python.org/cpython/rev/9d9e445d25dc
msg245661 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-06-23 02:58
There are a few references left in that revision. For instance <https://docs.python.org/3.5/library/asyncio-task.html#coroutines> still suggests scheduling a coroutine by calling async(). But depending on the context this may cause a syntax error in 3.5, so I think it should suggest calling ensure_future() instead.
msg246017 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-07-01 02:03
Reopening. The patch still applies to the current code (e.g. revision df310e5ac015, 30 June). It changes eight references of “async()” that still exist in this revision.
msg246020 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-07-01 02:14
New changeset 1b3be273e327 by Yury Selivanov in branch '3.5':
Issue #24487: Rename async() -> ensure_future() in asyncio docs.
https://hg.python.org/cpython/rev/1b3be273e327

New changeset 3dc2a113e8a7 by Yury Selivanov in branch 'default':
Merge 3.5 (Issue #24487)
https://hg.python.org/cpython/rev/3dc2a113e8a7
msg246021 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2015-07-01 02:14
Thanks, Martin!
History
Date User Action Args
2015-07-01 02:38:24yselivanovsetstatus: open -> closed
2015-07-01 02:14:53yselivanovsetresolution: out of date -> fixed
messages: + msg246021
2015-07-01 02:14:15python-devsetnosy: + python-dev
messages: + msg246020
2015-07-01 02:03:53martin.pantersetstatus: closed -> open

messages: + msg246017
2015-06-23 02:58:20martin.pantersetmessages: + msg245661
2015-06-22 15:01:27zach.waresetresolution: not a bug -> out of date
stage: patch review -> resolved
2015-06-22 14:56:22yselivanovsetstatus: open -> closed
resolution: not a bug
messages: + msg245633
2015-06-22 14:24:29martin.pantercreate