]> granicus.if.org Git - python/commitdiff
bpo-32272: Remove asyncio.async() function. (#4784)
authorYury Selivanov <yury@magic.io>
Mon, 11 Dec 2017 15:03:48 +0000 (10:03 -0500)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2017 15:03:48 +0000 (10:03 -0500)
Doc/library/asyncio-eventloop.rst
Doc/library/asyncio-task.rst
Lib/asyncio/tasks.py
Misc/NEWS.d/next/Library/2017-12-10-18-59-13.bpo-32272.Mu84Am.rst [new file with mode: 0644]

index 760640fa5e41caac98fef2d20ee949fb11d590e2..c582b2779b00b9ad9e04f349571cacb9a102fb5a 100644 (file)
@@ -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)
index ff35b0add9d694febe817e1a8d8e5396944f78b4..3656f793debd66f96b239ba717cb61bb7ce09682 100644 (file)
@@ -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`
index e0af5abdf23855f6c8b17f791f9bdb500266ed87..c5122f760715ac28b324697b03e8546b3d249f25 100644 (file)
@@ -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 @@ async def sleep(delay, result=None, *, loop=None):
         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 (file)
index 0000000..500e3c8
--- /dev/null
@@ -0,0 +1 @@
+Remove asyncio.async() function.