Commit graph

147 commits

Author SHA1 Message Date
Miss Islington (bot)
125f75cc13
doc: Remove a duplicate 'versionchanged' in library/asyncio-task (gh-102677)
(cherry picked from commit 7bdb331b67)

Co-authored-by: Joongi Kim <me@daybreaker.info>
2023-03-13 19:26:24 -07:00
Oleg Iarygin
7d727518be
[3.10] gh-97725: Fix documentation for the default file of asyncio.Task.print_stack (#101652) (#101654)
(cherry picked from commit f87f6e2396)
2023-02-08 11:02:54 +01:00
Stanley
4572c98ad2
[3.10] gh-85073: Add some missing links to source (GH-99363) (#99589)
(cherry picked from commit 27d8dc2c9d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-19 06:44:52 -08:00
C.A.M. Gerlach
b2db1c2080
[3.10] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98373)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>.
(cherry picked from commit fa2d43e518)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-10-18 01:49:47 +02:00
Miss Islington (bot)
9b710581a3
gh-94972: document that shield users need to keep a reference to their task (GH-96724)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
(cherry picked from commit 6281affee6)

Co-authored-by: Hendrik Makait <hendrik.makait@gmail.com>
2022-09-10 07:57:44 -07:00
Miss Islington (bot)
c7b5a2d5ea
gh-88831: In docs for asyncio.create_task, explain why strong references to tasks are needed (GH-93258) (GH-93567)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 75ceae05c1)

Co-authored-by: Andreas Grommek <76997441+agrommek@users.noreply.github.com>
2022-06-07 12:14:25 +02:00
Miss Islington (bot)
bb2dcf1c79
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (GH-92224)
(cherry picked from commit d1b2e989be)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-05-04 17:30:54 -07:00
Miss Islington (bot)
6eb34772fd
bpo-46777: Fix incorrect use of directives in asyncio documentation (GH-31388)
(cherry picked from commit 2923d87ca2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-02-18 01:30:36 -08:00
Terry Jan Reedy
5603db43ba
[3.10] bpo-46609: Update asyncio-task coroutine doc (GH-31132)
@coroutine in removed in 3.11, not 3.10.
2022-02-04 14:59:23 -05:00
Andrew Svetlov
991736697d
[3.10] bpo-46040: Fix removal text for @asyncio.coroutine (GH-30061) 2021-12-11 20:27:47 +02:00
Miss Islington (bot)
7bac598819
Save a reference for ensure_future and create_task (GH-29163)
Co-authored-by: Joannah Nanjekye <jnanjekye@python.org>
(cherry picked from commit c750adbe69)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2021-11-16 03:51:19 -08:00
Miss Islington (bot)
662ace1093
Doc: Fix wrong exception used in example. (GH-26572)
(cherry picked from commit 15f0fc571c)

Co-authored-by: Julien Palard <julien@palard.fr>
2021-07-08 21:51:26 -07:00
Miss Islington (bot)
150a8e8a3e
[3.10] bpo-42392: [docs] Add deprecated-removed loop labels for asyncio (GH-26357) (GH-26390)
* Add deprecated-removed loop labels for all reelvant functions/classes in asyncio
(cherry picked from commit d8fd8c8568)


Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Automerge-Triggered-By: GH:gpshead
2021-05-26 15:19:42 -07:00
Miss Islington (bot)
464269778b
Updated code example for asyncio.gather (GH-20604) (GH-26119)
The previous example did not fully showcase the interest of using gather.

Here the example showcases "the result is an aggregate list of returned values".
(cherry picked from commit 56b8ea65d2)

Co-authored-by: josephernest <nouvellecollection@gmail.com>

Co-authored-by: josephernest <nouvellecollection@gmail.com>
2021-05-13 23:07:20 -07:00
Serhiy Storchaka
172c0f2752
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().
2021-04-25 13:40:44 +03:00
Simon Willison
5c30145afb
bpo-42783: Documentation for asyncio.sleep(0) (#24002)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-01-07 12:03:18 +10:00
Andre Delfino
dcc997cd28
[doc] Fix erroneous backslashes in signatures and names (GH-23658)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).

The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.
2020-12-16 17:37:28 -08:00
Yurii Karabas
86150d39c8
bpo-42392: Remove deprecated loop parameter from docs (GH-23552) 2020-11-29 14:50:57 +02:00
Jesús Cea
989af25616
Typo (#23482) 2020-11-24 00:56:30 +01:00
Jakub Stasiak
3d86d090dc
bpo-42230: Improve asyncio documentation regarding accepting sets vs iterables (GH-23073)
People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] https://github.com/aio-libs/aiokafka/pull/672
[2] 620989bac5/stdlib/3/asyncio/tasks.pyi (L161)
[3] 620989bac5/stdlib/3/asyncio/tasks.pyi (L40)
2020-11-02 12:56:35 +02:00
Vinay Sharma
d42528a3a2
bpo-37703: improve asyncio.gather documentation regarding cancellation (GH-15312)
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()

Automerge-Triggered-By: @asvetlov
2020-07-20 01:42:57 -07:00
Rémi Lapeyre
004e64e805
bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all_tasks() (GH-20874) 2020-07-01 20:41:21 -07:00
Kyle Stanley
2b201369b4
Fix asyncio.to_thread() documented return type (GH-20547)
When I wrote the documentation for `asyncio.to_thread()`, I mistakenly assumed that `return await loop.run_in_executor(...)` within an async def function would return a Future. In reality, it returns a coroutine.

This likely won't affect typical usage of `asyncio.to_thread()`, but it's important for the documentation to be correct here. In general, we also tend to avoid returning futures from high-level APIs in asyncio.
2020-05-31 00:07:04 -07:00
Bar Harel
13206b52d1
bpo-40405: Fix asyncio.as_completed docs (GH-19753)
* Fix as_completed docs to correctly state the function return value.
* Also, improves the general wording of the as_completed documentation.

Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
2020-05-23 19:14:31 -04:00
Kyle Stanley
0f56263e62
bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)
Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143#discussion_r427808225) in GH-20143 for context.

Automerge-Triggered-By: @aeros
2020-05-20 22:20:43 -07:00
Kyle Stanley
cc2bbc2227
bpo-32309: Implement asyncio.to_thread() (GH-20143)
Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410#issuecomment-628930973) in GH-18410 for context.

Automerge-Triggered-By: @aeros
2020-05-18 20:03:28 -07:00
Chris Jerdonek
1ce5841eca
bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979) 2020-05-15 16:55:50 -07:00
romasku
382a5635bd
bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() (GH-20054)
Currently, if asyncio.wait_for() timeout expires, it cancels
inner future and then always raises TimeoutError. In case
those future is task, it can handle cancelation mannually,
and those process can lead to some other exception. Current
implementation silently loses thoses exception.

To resolve this, wait_for will check was the cancelation
successfull or not. In case there was exception, wait_for
will reraise it.

Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
2020-05-15 13:12:05 -07:00
jack1142
de92769d47
bpo-34790: add version of removal of explicit passing of coros to asyncio.wait's documentation (#20008) 2020-05-13 11:55:12 -07:00
Joel Rosdahl
9d74658f0a
bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)
A similar formulation was added in bpo-21596
(db74d982d4) but was lost in bpo-33649
(3faaa8857a).
2020-05-04 14:56:00 -07:00
Kyle Stanley
f900064ac4 docs: Add asyncio source code links (GH-16640) 2019-10-10 19:18:46 -04:00
Kyle Stanley
e407013089 Fix and improve asyncio.run() docs (GH-16403) 2019-09-30 17:12:21 -07:00
Emmanuel Arias
17deb16883 bpo-38260: Add Docs on asyncio.run (GH-16337)
Add docs about return and raise exception on asyncio.run





https://bugs.python.org/issue38260



Automerge-Triggered-By: @asvetlov
2019-09-25 01:53:49 -07:00
Kyle Stanley
77af2290e5 Doc: Remove provisional note for asyncio.run() (GH-16310)
Based on a comment from @asvetlov https://github.com/python/cpython/pull/15735#discussion_r323619076, this removes the provisional note for ``asyncio.run()`` in the documentation.

Automerge-Triggered-By: @1st1
2019-09-20 16:46:21 -07:00
Kyle Stanley
9fdc64cf12 bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() (GH-15735) 2019-09-19 15:47:22 +03:00
Andrew Svetlov
a488879cba
bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033) 2019-09-12 15:40:40 +03:00
Alex Grönholm
98ef92002e bpo-36999: Add asyncio.Task.get_coro() (GH-13680)
https://bugs.python.org/issue36999
2019-05-30 08:30:09 -07:00
Matthias Bussonnier
d0ebf13e50 bpo-36932: use proper deprecation-removed directive (GH-13349)
.. And update some deprecation warnings with version numbers.




https://bugs.python.org/issue36932
2019-05-20 23:20:10 -07:00
Boštjan Mejak
1d5bdef550 Orthographical fix (GH-13418)
Add a missing comma.
2019-05-19 02:01:36 -07:00
Andrew Svetlov
68b34a7204 bpo-36921: Deprecate @coroutine for sake of async def (GH-13346)
The second attempt. Now deprecate `@coroutine` only, keep `yield from fut` as is.


https://bugs.python.org/issue36921
2019-05-16 07:52:10 -07:00
Vaibhav Gupta
3a81076bbf bpo-35579: Fix typo in in asyncio-task documentation (GH-11321)
https://bugs.python.org/issue35579


https://bugs.python.org/issue35579
2018-12-26 06:47:16 -08:00
Mariatta
9f43fbbd9d Use f-strings in asyncio-task code examples (GH-10035)
Replace str.format with f-strings in the code examples of asyncio-task documentation.
2018-10-25 00:37:12 +02:00
Hrvoje Nikšić
cd602b8af2 bpo-34476: Document that asyncio.sleep() always suspends. (#9643) 2018-10-01 13:09:38 +03:00
Yury Selivanov
59ee5b1293
bpo-34802: Fix asyncio.iscoroutine() docs (GH-9611) 2018-09-27 15:48:30 -04:00
Yury Selivanov
fad6af2744
asyncio/docs: Replace Python 4.0 -> 3.10 (GH-9579) 2018-09-25 17:44:52 -04:00
Yury Selivanov
996859a90d
bpo-34790: [docs] Passing coroutines to asyncio.wait() can be confusing. (GH-9543) 2018-09-25 14:51:21 -04:00
Yury Selivanov
db1a80e97a
bpo-33649: Fix gather() docs; fix title; few other nits. (GH-9475) 2018-09-21 16:23:15 -04:00
Yury Selivanov
e247b46cba
bpo-33649: More improvements (GH-9439) 2018-09-20 12:43:59 -04:00
Yury Selivanov
471503954a
bpo-33649: Add a high-level section about Futures; few quick fixes (GH-9403)
Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-09-18 17:55:44 -04:00
Yury Selivanov
b042cf10c6
bpo-33649: Fix markup; add another note that asyncio.run is 3.7+ (GH-9389) 2018-09-18 02:47:54 -04:00