bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)
asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index 1ca1b4a..3f54ecb 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -397,6 +397,11 @@
If the *gather* itself is cancelled, the cancellation is
propagated regardless of *return_exceptions*.
+ .. deprecated:: 3.10
+ Deprecation warning is emitted if no positional arguments are provided
+ or not all positional arguments are Future-like objects
+ and there is no running event loop.
+
Shielding From Cancellation
===========================
@@ -434,6 +439,10 @@
except CancelledError:
res = None
+ .. deprecated:: 3.10
+ Deprecation warning is emitted if *aw* is not Future-like object
+ and there is no running event loop.
+
Timeouts
========
@@ -593,6 +602,10 @@
earliest_result = await coro
# ...
+ .. deprecated:: 3.10
+ Deprecation warning is emitted if not all awaitable objects in the *aws*
+ iterable are Future-like objects and there is no running event loop.
+
Running in Threads
==================
@@ -775,6 +788,10 @@
.. deprecated-removed:: 3.8 3.10
The *loop* parameter.
+ .. deprecated:: 3.10
+ Deprecation warning is emitted if *loop* is not specified
+ and there is no running event loop.
+
.. method:: cancel(msg=None)
Request the Task to be cancelled.