cpython/Doc/howto
Miss Islington (bot) ddf951c616
[3.13] gh-137026: Add an explainer guide for asyncio (GH-137215) (#137582)
gh-137026: Add an explainer guide for asyncio (GH-137215)

* - Add an explainer guide (aka HOWTO, not how-to) for asyncio.

* Fix linter errors.

* - Enforce max line length of roughly 79 chars.
- Start sentences on new lines to minimize disruption of diffs.

* Add reference to subinterpreters.

* - Significantly reduce article size. Remove both example sections & "Which concurrency do I want" section.

* Align section-header lengths with section names.

* - Remove reference to deleted section.

* - Fix a variety of rote style guide items like title-alignment, use of ie and $, and so forth.
- Add links to other parts of the docs for keywords and objects like await, coro, task, future, etc.

* - One last title alignment.

* - Style nit.

* - Rework a variety of I statements.

* Lint fix.

* - Firm up commentary on yield from in corotuines.

* Update language comparing await and yield from.

* - Remove await-ing Tasks and futures section

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* - Address comments related to style & writing flow.

* per-thread event loop note.

* Add section describing coroutines roots in generators.

* Phrasing tweak.

* Use asyncio.create_task instead of asyncio.Task

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* small phrasing.

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* phrasing nit.

* style nits

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* phrasing nit

* Fix misnaming of async generator.

* phrasing nits.

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* consistent spacing

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* phrasing nits

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* add conclusion

* nits

* - Variety of style & grammar improvements thanks to ZeroIntensity's comments.

* - Make all directives start with a 3 space indent. Then 4 thereafter.

* - Use :linenos: instead of manually writing the line numbers.

* - Fix label typo for article.

* fix label link.

* Apply suggestions from code review





* - introduce async-sleep name

* Phrasing

* nit

* ungendered octopus

* teammates

* jobs

* rework fella to penguin

* - remove byline; add seealso

* Change ref from asyncio to use seealso block.

* Remove typehints. Fix indentation in one code example.

* Slight rephrase for clarity.

* Make references point to asyncio. Wrap some long lines.

* - Variety of style/phrasing improvements based on PR feedback.

* phrasing.

* phrasing nit.

* Apply suggestions from code review



* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* nit

* Apply suggestions from code review



* fix backticks.

* nits

* nit

* add section on asyncio.run

* title change under the hood.

* modify task coro example.

* howtos article link.

* prefer await without backticks.

* phrasing tweak.

* Rework phrasing around how await tasks pauses and returns control in the await section.

* move code block to beforfe explanation in coroutine under the hood.

* phrasing.

* link to yield from.

* style nits

* nit

* - Modify language re: event-loop cycling endlessly.
- Discuss why await was designed to not yield for coros.

* - Add a note about debug=True on asyncio.run to await coro section.

* clarity nit

* - Add two other references in seealso block.

* nit

* Language simplification

* Apply suggestions from code review



* nit

* grammar fix.

* fix

* worker bees

* rework event loop paragraph to significantly deemphasize queues

* remove all references to queue besides the initial analogy.

* add note about garbage collection of tasks

* add practical note re: garbage collection

* phrasing nits

* re arrange note on task gc.

* line wrap nit

* Update Doc/howto/a-conceptual-overview-of-asyncio.rst



* link to debug mode docs.

* readd part2 prefix.

* simplify title.

* fix titles. tihnk I messed this up earlier.

* avoid idiom in title.

* fix titles once agian.

* Apply suggestions from code review



* rework task gc example.

* phrasing tweak.

* tewak.

* nit

* nit

* nit

* nit

---------
(cherry picked from commit 3964f97489)

Co-authored-by: Alexander Nordin <alexander.f.nordin@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-08-09 05:35:38 +00:00
..
a-conceptual-overview-of-asyncio.rst [3.13] gh-137026: Add an explainer guide for asyncio (GH-137215) (#137582) 2025-08-09 05:35:38 +00:00
annotations.rst [3.13] gh-101100: Add a table of class attributes to the "Custom classes" section of the data model docs (#124480) (#124556) 2024-09-25 17:29:48 -07:00
argparse-optparse.rst [3.13] gh-126180: Remove getopt and optparse deprecation notices (GH-128191) 2024-12-23 04:40:59 +00:00
argparse.rst [3.13] gh-126180: Remove getopt and optparse deprecation notices (GH-128191) 2024-12-23 04:40:59 +00:00
clinic.rst GH-107518: Remove the Argument Clinic How-To (#109900) 2023-10-11 14:57:51 +02:00
cporting.rst [3.13] gh-133678: Document C API third party tools (GH-134526) (#134792) 2025-05-27 15:44:44 +00:00
curses.rst [3.13] Fix example code in curses tutorial (GH-126446) (#132362) 2025-04-10 12:13:50 +00:00
descriptor.rst [3.13] gh-101100: Fix sphinx warnings in howto/* (GH-127084) (#127287) 2024-11-26 08:27:25 +00:00
enum.rst [3.13] gh-101100: Fix sphinx warnings in howto/* (GH-127084) (#127287) 2024-11-26 08:27:25 +00:00
free-threading-extensions.rst [3.13] gh-137043: mention PyList_GET_ITEM as unsafe borrowed API in free-threading docs (GH-137042) (#137046) 2025-07-23 14:42:53 +00:00
free-threading-python.rst [3.13] Docs: fix link in free-threading-python.rst (GH-134548) (#134556) 2025-05-23 00:43:26 +00:00
functional.rst [3.13] gh-136135: Doc: Fix some broken links (GH-136137) (GH-136219) 2025-07-03 00:59:13 +00:00
gdb_helpers.rst [3.13] [Docs] GDB howto: Fix block type of a cast example (GH-127621) (#127653) 2024-12-05 20:58:36 +00:00
index.rst [3.13] gh-137026: Add an explainer guide for asyncio (GH-137215) (#137582) 2025-08-09 05:35:38 +00:00
instrumentation.rst [3.13] gh-123492: Remove unnecessary :func: parentheses (gh-123493) (#123513) 2024-08-30 20:14:48 +03:00
ipaddress.rst bpo-44740: Make minor edits to lowercasing "internet" and "web". (GH-27385) 2021-07-27 10:57:52 +02:00
isolating-extensions.rst [3.13] Replace capi-sig mailing list with discuss.python.org (GH-136211) (#136214) 2025-07-02 20:55:17 +03:00
logging-cookbook.rst [3.13] gh-94503: Update logging cookbook example with info on addressing log injection. (GH-136446) (GH-136450) 2025-07-09 09:00:07 +01:00
logging.rst [3.13] gh-136882: Update stale link in the basic logging tutorial. (GH-136885) (#136906) 2025-07-21 12:04:28 +03:00
logging_flow.png [3.13] gh-121035: Update PNG image for logging flow diagram. (GH-121323) (GH-121324) 2024-07-03 13:01:34 +01:00
logging_flow.svg [3.13] gh-121035: Further improve logging flow diagram with respect to dark/light modes. (GH-121265) (GH-121320) 2024-07-03 11:41:18 +01:00
mro.rst [3.13] Docs: fix typo in Doc/howto/mro.rst (GH-129095) (GH-129122) 2025-01-21 10:40:31 +01:00
perf_profiling.rst [3.13] gh-130861: Add clarification to the perf docs on optimization levels (GH-131098) (#132687) 2025-04-18 13:48:23 +00:00
pyporting.rst [3.13] gh-119779: Fix pyporting howto docs (GH-119785) (#119788) 2024-05-30 16:09:31 +00:00
regex.rst [3.13] Docs: Add missing lines between regex and text (GH-134505) (GH-135719) 2025-06-19 15:07:40 +00:00
sockets.rst Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) 2022-06-09 15:55:06 +02:00
sorting.rst Make the title match the content (GH-115702) 2024-02-20 01:51:56 -06:00
timerfd.rst Fix typo in Doc/howto/timerfd.rst (GH-118376) 2024-04-29 14:01:03 +03:00
unicode.rst gh-101100: Fix some broken sphinx references (#107095) 2023-07-23 03:23:44 -06:00
urllib2.rst [3.13] gh-134835: Remove outdated list from howto/urllib2.rst (GH-134844) (#134985) 2025-05-31 17:54:38 +00:00