bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)

This commit is contained in:
Andrew Svetlov 2022-04-01 04:25:15 +03:00 committed by GitHub
parent ab89ccff3c
commit d4bb38f82b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 133 additions and 15 deletions

View file

@ -48,16 +48,27 @@ For this purpose the following, *private* constructors are listed:
.. method:: Future.__init__(*, loop=None)
Create a built-in future instance.
Create a built-in future instance.
*loop* is an optional event loop instance.
*loop* is an optional event loop instance.
.. method:: Task.__init__(coro, *, loop=None, name=None, context=None)
Create a built-in task instance.
Create a built-in task instance.
*loop* is an optional event loop instance. The rest of arguments are described in
:meth:`loop.create_task` description.
*loop* is an optional event loop instance. The rest of arguments are described in
:meth:`loop.create_task` description.
.. versionchanged:: 3.11
*context* argument is added.
.. method:: Tasl._check_future(future)
Return ``True`` if *future* is attached to the same loop as the task, ``False``
otherwise.
.. versionadded:: 3.11
Task lifetime support