828 Commits
Author SHA1 Message Date
f336df0575 Doc: Fix errors in documentation examples (GH-160742)
(cherry picked from commit 085d3665b1)

Co-authored-by: Inada Naoki <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
2026-10-27 11:02:44 +00:00
Ned BatchelderandGitHub 0e6a7f8822 [3.14] Docs: split builtins to their own page from library (GH-156682) (#157441)
* Docs: split builtins to their own page from library

* review feedback

* addressed Hugo's feedback

* update the What's Next page

* one more wording tweak

* move builtins to their own directory. fix the reference name

* moved pages need to be noted in tools/removed-ids.txt

* add Python to the builtins reference title

* add sphinxext-rediraffe for the library->builtins split

* update check-html-ids to handle rediraffe redirects

* now we don't need (page missing) for the redirected pages

* update other references to moved pages

* A seealso from builtins to library

* make a nice section for rediraffe settings

* move the builtins note to the end, as a seealso

* address merwok's comments

* cache looking for ids in files

* simplify the intro paragraphs
(cherry picked from commit 59c4bddb17)
2026-09-13 13:02:13 -04:00
04ed190e87 [3.14] gh-141984: Add "exhausted" to glossary, link existing mentions (GH-157225) (GH-157272)
(cherry picked from commit 9bd670cba2)

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Blaise Pabon <[email protected]>
2026-09-10 17:16:23 +02:00
958c1b6d8e [3.14] Add a page detailing the time complexity of operations on built-in types (GH-154363) (#156337)
* Add a page detailing the time complexity of operations on built-in types (GH-154363)
(cherry picked from commit c3f7c33dd7)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Pieter Eendebak <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
Co-authored-by: dgpb <[email protected]>

* Remove 3.15-only frozendict mentions

---------

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
Co-authored-by: Pieter Eendebak <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
Co-authored-by: dgpb <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
2026-09-03 11:24:58 -04:00
Ned BatchelderandGitHub 8dd272ffe0 [3.14] Docs: remove __path__ discussion from tutorial (GH-156426) (#156454)
* Docs: remove __path__ discussion from tutorial

This isn't the current best way to make namespace packages; almost no
one needs to make namespace packages; the deleted text even says "while
this feature is not often needed".  It doesn't belong in the tutorial.

(cherry picked from commit 79f41dd9f3)
2026-08-27 07:06:31 -04:00
1547edc4b3 [3.14] gh-148216: Fix hyphenation in tutorial/stdlib.rst (GH-155736) (#156084)
gh-148216: Fix hyphenation in tutorial/stdlib.rst (GH-155736)
(cherry picked from commit 5be8020761)

Co-authored-by: Michele Angrisano <[email protected]>
2026-08-20 07:33:04 +00:00
Miss Islington (bot)andGitHub bbdd3e5e72 [3.14] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151300)
(cherry picked from commit 84630e2cb9)
2026-06-11 07:37:38 +01:00
41f475c996 [3.14] gh-149035: Modernize legacy Python patterns in Doc/tutorial/stdlib2.rst (GH-149036) (#149089)
Co-authored-by: ByteFlow <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-04-28 05:17:18 +00:00
de54353235 [3.14] gh-144837: Improve documentation for more collection methods (GH-144841) (GH-146483)
Use uniform standard signature syntax in the tutorial and in
the array and collections modules documentation.
(cherry picked from commit 17070f41d4)

Co-authored-by: Serhiy Storchaka <[email protected]>
2026-03-26 19:55:25 +00:00
abd276ab3d [3.14] docs: fix f-string in ExceptionGroup example (GH-146108) (GH-146126)
(cherry picked from commit 2c6afb935a)

Co-authored-by: Bartosz Grabowski <[email protected]>
2026-03-24 00:09:00 +01:00
d65e8d9094 [3.14] Docs: replace all datetime imports with import datetime as dt (GH-145640) (#146258)
Docs: replace all `datetime` imports with `import datetime as dt` (GH-145640)
(cherry picked from commit 83360b5869)

Co-authored-by: Hugo van Kemenade <[email protected]>
2026-03-21 20:19:07 +02:00
4601007395 [3.14] Docs: a brief note in the sets tutorial about order (GH-145984) (#146049)
Docs: a brief note in the sets tutorial about order (GH-145984)
(cherry picked from commit 4f5e79805e)


Docs: a brief note in the sets tut about order

Co-authored-by: Ned Batchelder <[email protected]>
2026-03-17 05:18:11 -04:00
b5e5013378 [3.14] Docs: except with multiple exceptions parentheses not required (GH-145848) (#145904)
Docs: except with multiple exceptions parentheses not required (GH-145848)

As of PEP 758 the except statement doesn't require parentheses anymore for exception tuples.
(cherry picked from commit 6d1e9ceed3)


See: https://peps.python.org/pep-0758/

Co-authored-by: Maurizio Sambati <[email protected]>
2026-03-13 06:12:02 -04:00
d910638418 [3.14] gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643) (#145647)
gh-145642: Docs: Avoid warning for invalid escape sequence in tutorial (GH-145643)

---------
(cherry picked from commit 5a15a52dd1)

Co-authored-by: James <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
2026-03-09 00:05:09 +01:00
b1accd51d8 [3.14] Fix typos and grammar errors across documentation (GH-144709) (#144801)
(cherry picked from commit 3718f4be60)

Co-authored-by: Ronald Eddy Jr <[email protected]>
2026-02-17 12:53:42 +00:00
145879b402 [3.14] gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142) (GH-143791)
gh-137113 docs: note readline no longer supported in REPL after 3.13 (GH-137142)

Add a note to the readline module documentation stating that
Python 3.13 and later no longer supports readline in the default REPL,
as per gh-118840. Includes workaround using PYTHON_BASIC_REPL.

Update tutorial to remove the reference, and use a different key to
test things out.
(cherry picked from commit 971f387bbb)

Signed-off-by: Kuang Yu Heng <[email protected]>
Co-authored-by: Kuang Yu Heng <[email protected]>
2026-01-14 10:55:52 +01:00
f6f3ddb401 [3.14] gh-143048: Remove outdated mention to curses in the "Interactive Mode" docs (GH-143049) (#143325)
gh-143048: Remove outdated mention to `curses` in the "Interactive Mode" docs (GH-143049)
(cherry picked from commit 2d9f4e357a)

Co-authored-by: Bartosz Sławecki <[email protected]>
2026-01-01 11:57:57 +00:00
decorator-factoryandGitHub 78dd2d5ba9 [3.14] gh-142411: Change documentation to reflect the new docstring adjustments in 3.13 (GH-142413) (#142689) 2025-12-14 14:22:30 +02:00
3824ad0286 [3.14] Improve clarity in tutorial introduction (GH-140669) (#142112)
Co-authored-by: Thierry Martos <[email protected]>
2025-11-30 12:53:05 +00:00
996c00384d [3.14] gh-141412: Use reliable target URL for urllib example (GH-141474)
The endpoint used for demonstrating reading URLs is no longer
stable. This change substitutes a target over which we have more
control.
(cherry picked from commit fbcac79951)

Co-authored-by: Bob Kline <[email protected]>
2025-11-12 18:40:20 +00:00
a468ba0a9d [3.14] gh-140379: add hyperlinks to list and set (GH-140399) (#141386)
gh-140379: add hyperlinks to list and set (GH-140399)

add hyperlinks to list and set
(cherry picked from commit 92741c59f8)

Co-authored-by: Krishna Chaitanya <[email protected]>
2025-11-11 06:08:45 +00:00
Filip ŁajszczakandGitHub dc76de26e5 [3.14] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141025)
Update selected RFC 2822 references to RFC 5322

RFC 2822 was obsoleted by RFC 5322 in 2008. This updates references
to use the current standard in documentation, docstrings, and comments.

It preserves RFC 2822 references in legacy API components to maintain their
historical context.

RFC 822 → RFC 2822 → RFC 5322 progression is explained where relevant.

In some places specific sections of RFC are referenced where it seems helpful.

Scout rule was applied in some places and RFC mentions format was
normalized in doc strings and comments.
(cherry picked from commit ce1bb85d28)
2025-11-04 16:23:16 -05:00
5b88a6533c [3.14] Fix minor typo: 'web site' -> 'website' (GH-140561) (GH-140976)
(cherry picked from commit 08115d241a)

Co-authored-by: commitWithTisha <[email protected]>
2025-11-04 14:11:08 +01:00
57c37a4623 [3.14] gh-116488: Mention dict.get in the data structures tutorial (GH-139643) (#139655)
Co-authored-by: Cycloctane <[email protected]>
2025-10-06 19:04:44 +03:00
dd930baf45 [3.14] gh-138307: Update the Ellipsis documentation (GH-138306) (#138440)
Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Éric <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>
2025-09-11 12:22:37 +03:00
829c81ae21 [3.14] GH-101100: Remove some entries from `nitpick_ignore` (GH-138464) (#138683)
* GH-101100: Remove some entries from ``nitpick_ignore`` (GH-138464)
(cherry picked from commit 22cb9ba8f9)

Co-authored-by: Adam Turner <[email protected]>

* Update check-warnings.py

---------

Co-authored-by: Adam Turner <[email protected]>
2025-09-09 19:12:40 +03:00
f153e32cba [3.14] GH-138465: Improve documentation for common sequence methods (GH-138474) (#138560)
GH-138465: Improve documentation for common sequence methods (GH-138474)
(cherry picked from commit 8ed1d53e62)

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Serhiy Storchaka <[email protected]>
2025-09-06 08:51:48 +03:00
66f256d874 [3.14] gh-107194: Improved language of list.index in tutorial (gh-138518) (#138527)
gh-107194: Improved language of list.index in tutorial (gh-138518)
(cherry picked from commit f19f1d8563)

Co-authored-by: Ric <[email protected]>
2025-09-05 10:51:28 +03:00
9e5ca3a411 [3.14] gh-138011: Clarify tutorial method object example code (GH-138014) (#138025)
Co-authored-by: Terry Jan Reedy <[email protected]>
2025-08-27 16:59:47 +03:00
e817d1aa2b [3.14] gh-132661: PEP 750 documentation: second pass (GH-137020) (#137392)
gh-132661: PEP 750 documentation: second pass (GH-137020)
(cherry picked from commit 4dae9b1ff1)

Co-authored-by: Adam Turner <[email protected]>
2025-08-16 09:21:29 +03:00
3de6ea5d8f [3.14] gh-109975: Indicate the minimum version for PyREPL in the tutorial (GH-136046) (#137766)
Co-authored-by: Konstantin Morenko <[email protected]>
2025-08-15 13:15:30 +03:00
c59a60bdb4 [3.14] gh-132661: Document t-strings and templatelib (GH-135229) (#136974)
Co-authored-by: Dave Peck <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Loïc Simon <[email protected]>
Co-authored-by: pauleveritt <[email protected]>
Co-authored-by: Lysandros Nikolaou <[email protected]>
2025-07-22 13:32:00 +03:00
f86a59549b [3.14] Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) (#136940)
Pedantic rewording of why relative importing doesn't work in main modules (GH-136846)

Pedantically reword the section about relative imports and main modules.
(cherry picked from commit 4b68289ca6)

Co-authored-by: Josh Cannon <[email protected]>
2025-07-21 09:58:27 -07:00
cf2209f5b9 [3.14] Update tutorial for new "Copy" button (GH-135007) (#135270)
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Sergey B Kirpichev <[email protected]>
2025-06-08 16:40:07 +00:00
23552b3d8f [3.14] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) (#135212)
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181)

Giving the right example incitates the tutorial readers to do the same in the future.
(cherry picked from commit 343182853f)

Co-authored-by: Jean-Louis GUENEGO <[email protected]>
2025-06-06 13:22:50 +00:00
37c2c8c9d8 [3.14] Docs: Add note to tutorial clarifying scope (GH-134534) (#134536)
Docs: Add note to tutorial clarifying scope (GH-134534)

* Add note to tutorial

* Update formatting
(cherry picked from commit 742d5b5c5d)

Co-authored-by: Kattni <[email protected]>
2025-05-22 18:32:49 +00:00
11650c354f [3.14] fix indent in controlflow.rst docs (GH-134008) (#134184)
fix indent in `controlflow.rst` docs (GH-134008)
(cherry picked from commit 4ce91871a9)

Co-authored-by: Yongzi Li <[email protected]>
2025-05-18 16:29:03 +00:00
075cabb026 [3.14] gh-133881: add forward reference to list.sort() in lambda expression tutorial (GH-133910) (#134126)
gh-133881: add forward reference to `list.sort()` in lambda expression tutorial (GH-133910)
(cherry picked from commit c1c9ad1d5a)

Co-authored-by: Oleg Burnaev <[email protected]>
2025-05-17 08:05:47 +00:00
3cd4c2db7b [3.14] Doc: Allow translating a code block in the tutorial (GH-131353) (#133648)
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872)

Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
2025-05-08 09:28:58 +00:00
Irit KatrielandGitHub ffc2f1dd1c gh-130080: implement PEP 765 (#130087) 2025-03-17 20:48:54 +00:00
30d5205849 gh-116666: Add "token" glossary term (GH-130888)
Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)

Co-authored-by: Adam Turner <[email protected]>
2025-03-17 17:05:47 +01:00
Tshepang MbamboandGitHub 1b5db5adfe GH-130153: Reword the wildcard matching part of the tutorial (GH-129954) 2025-03-05 14:59:47 -08:00
73801864d8 gh-122876: Fix "End of lines" typo (#125310)
Co-authored-by: Hugo van Kemenade <[email protected]>
2025-02-19 19:16:38 +00:00
shallow-beachandGitHub 5a584c8f54 Python Tutorial typo fix (#128077) 2024-12-20 18:09:56 +01:00
Yuki KobayashiandGitHub 77a61c0465 gh-101100: amend references starting with !~ in gh-127054 (#127684) 2024-12-06 16:09:20 +02:00
Yuki KobayashiandGitHub 3e812253ab gh-101100: Fix Sphinx warnings about list methods (#127054) 2024-12-02 15:51:35 +02:00
funkyrailroadandGitHub 26ff32b305 gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127267) 2024-11-25 15:34:01 -06:00
a3443c0e22 gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)
* bpo-41411 fstring index in tutorial/inputoutput

To assist in searching for fstrings I have added an index

* Add newline

---------

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Carol Willing <[email protected]>
2024-10-30 10:26:29 -07:00
Ned BatchelderandGitHub 2d9d10179f docs: restore an anchor to for/else (#126154) 2024-10-29 20:11:50 -04:00
Bogdana VerehaandGitHub a78d5b3242 Fix a typo in `Doc/tutorial/errors.rst` exception output (#126001) 2024-10-26 18:26:35 +03:00