Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task#134202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
gvanrossum merged 6 commits intopython:mainfromgraingert:doc-new-asyncio-create-task-kwargsMay 22, 2025
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
fc37061
gh-128307: update docs to TaskGroup.create_task and asyncio.create_task
graingert18b6bb5
Update Doc/library/asyncio-eventloop.rst
graingert10ac910
Update Doc/library/asyncio-eventloop.rst
graingert7d74976
Update Doc/library/asyncio-task.rst
graingert7127483
pre-commit
graingerta339251
Merge branch 'main' into doc-new-asyncio-create-task-kwargs
graingertFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -361,7 +361,7 @@ Creating Futures and Tasks | ||
.. versionadded:: 3.5.2 | ||
.. method:: loop.create_task(coro, *, name=None, context=None, eager_start=None, **kwargs) | ||
gvanrossum marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Schedule the execution of :ref:`coroutine <coroutine>` *coro*. | ||
Return a :class:`Task` object. | ||
@@ -370,6 +370,10 @@ Creating Futures and Tasks | ||
for interoperability. In this case, the result type is a subclass | ||
of :class:`Task`. | ||
The full function signature is largely the same as that of the | ||
:class:`Task` constructor (or factory) - all of the keyword arguments to | ||
this function are passed through to that interface. | ||
If the *name* argument is provided and not ``None``, it is set as | ||
the name of the task using :meth:`Task.set_name`. | ||
@@ -388,8 +392,15 @@ Creating Futures and Tasks | ||
.. versionchanged:: 3.11 | ||
Added the *context* parameter. | ||
.. versionchanged:: 3.13.3 | ||
Added ``kwargs`` which passes on arbitrary extra parameters, including ``name`` and ``context``. | ||
.. versionchanged:: 3.13.4 | ||
Rolled back the change that passes on *name* and *context* (if it is None), | ||
while still passing on other arbitrary keyword arguments (to avoid breaking backwards compatibility with 3.13.3). | ||
.. versionchanged:: 3.14 | ||
All *kwargs* are now passed on. The*eager_start* parameter works with eager task factories. | ||
.. method:: loop.set_task_factory(factory) | ||
@@ -402,6 +413,16 @@ Creating Futures and Tasks | ||
event loop, and *coro* is a coroutine object. The callable | ||
must pass on all *kwargs*, and return a :class:`asyncio.Task`-compatible object. | ||
.. versionchanged:: 3.13.3 | ||
Required that all *kwargs* are passed on to :class:`asyncio.Task`. | ||
.. versionchanged:: 3.13.4 | ||
*name* is no longer passed to task factories. *context* is no longer passed | ||
to task factories if it is ``None``. | ||
graingert marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
.. versionchanged:: 3.14 | ||
*name* and *context* are now unconditionally passed on to task factories again. | ||
.. method:: loop.get_task_factory() | ||
Return a task factory or ``None`` if the default one is in use. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.