[Python-checkins] bpo-32272: Remove asyncio.async() function. (#4784)

Yury Selivanov webhook-mailer at python.org
Mon Dec 11 10:03:51 EST 2017


https://github.com/python/cpython/commit/9edad3c7011ccab0a66a065933abebf3288cf1a1
commit: 9edad3c7011ccab0a66a065933abebf3288cf1a1
branch: master
author: Yury Selivanov <yury at magic.io>
committer: GitHub <noreply at github.com>
date: 2017-12-11T10:03:48-05:00
summary:

bpo-32272: Remove asyncio.async() function. (#4784)

files:
A Misc/NEWS.d/next/Library/2017-12-10-18-59-13.bpo-32272.Mu84Am.rst
M Doc/library/asyncio-eventloop.rst
M Doc/library/asyncio-task.rst
M Lib/asyncio/tasks.py

diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index 760640fa5e4..c582b2779b0 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -235,9 +235,6 @@ Tasks
    interoperability. In this case, the result type is a subclass of
    :class:`Task`.
 
-   This method was added in Python 3.4.2. Use the :func:`async` function to
-   support also older Python versions.
-
    .. versionadded:: 3.4.2
 
 .. method:: AbstractEventLoop.set_task_factory(factory)
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index ff35b0add9d..3656f793deb 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -538,12 +538,6 @@ Task functions
 
       The :meth:`AbstractEventLoop.create_task` method.
 
-.. function:: async(coro_or_future, \*, loop=None)
-
-   A deprecated alias to :func:`ensure_future`.
-
-   .. deprecated:: 3.4.4
-
 .. function:: wrap_future(future, \*, loop=None)
 
    Wrap a :class:`concurrent.futures.Future` object in a :class:`Future`
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
index e0af5abdf23..c5122f76071 100644
--- a/Lib/asyncio/tasks.py
+++ b/Lib/asyncio/tasks.py
@@ -3,7 +3,7 @@
 __all__ = (
     'Task',
     'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED',
-    'wait', 'wait_for', 'as_completed', 'sleep', 'async',
+    'wait', 'wait_for', 'as_completed', 'sleep',
     'gather', 'shield', 'ensure_future', 'run_coroutine_threadsafe',
 )
 
@@ -489,26 +489,6 @@ def __sleep0():
         h.cancel()
 
 
-def async_(coro_or_future, *, loop=None):
-    """Wrap a coroutine in a future.
-
-    If the argument is a Future, it is returned directly.
-
-    This function is deprecated in 3.5. Use asyncio.ensure_future() instead.
-    """
-
-    warnings.warn("asyncio.async() function is deprecated, use ensure_future()",
-                  DeprecationWarning,
-                  stacklevel=2)
-
-    return ensure_future(coro_or_future, loop=loop)
-
-# Silence DeprecationWarning:
-globals()['async'] = async_
-async_.__name__ = 'async'
-del async_
-
-
 def ensure_future(coro_or_future, *, loop=None):
     """Wrap a coroutine or an awaitable in a future.
 
diff --git a/Misc/NEWS.d/next/Library/2017-12-10-18-59-13.bpo-32272.Mu84Am.rst b/Misc/NEWS.d/next/Library/2017-12-10-18-59-13.bpo-32272.Mu84Am.rst
new file mode 100644
index 00000000000..500e3c8c2a5
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-12-10-18-59-13.bpo-32272.Mu84Am.rst
@@ -0,0 +1 @@
+Remove asyncio.async() function.



More information about the Python-checkins mailing list