Commit 9edad3c7 authored by Yury Selivanov's avatar Yury Selivanov Committed by GitHub

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

parent 1b74f9b7
......@@ -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)
......
......@@ -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`
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment