801 Commits

Author SHA1 Message Date
Miss Islington (bot)
fffd38b2dd
[3.13] gh-141412: Use reliable target URL for urllib example (GH-141475)
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 fbcac799518e0cb29fcf5f84ed1fa001010b9073)

Co-authored-by: Bob Kline <bkline@users.noreply.github.com>
2025-11-12 18:40:22 +00:00
Miss Islington (bot)
6d37d948d4
[3.13] gh-140379: add hyperlinks to list and set (GH-140399) (#141387)
gh-140379: add hyperlinks to list and set (GH-140399)

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

Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
2025-11-11 06:09:28 +00:00
Filip Łajszczak
d76e411891
[3.13] gh-139434: Update selected RFC 2822 references to RFC 5322 (GH-139435) (#141024)
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 ce1bb85d286130f44b7e874430b0b12990d61dc1)
2025-11-04 16:22:31 -05:00
Miss Islington (bot)
551d68d8cf
[3.13] Fix minor typo: 'web site' -> 'website' (GH-140561) (GH-140977)
(cherry picked from commit 08115d241a724a4769599993f654f77abcdebf5a)

Co-authored-by: commitWithTisha <tishaa1010@gmail.com>
2025-11-04 14:11:15 +01:00
Miss Islington (bot)
1d39dba759
[3.13] gh-116488: Mention dict.get in the data structures tutorial (GH-139643) (GH-139656)
gh-116488: Mention `dict.get` in the data structures tutorial (GH-139643)
(cherry picked from commit 69cfad0b3e1e2805914cb647cce4c7c2bfed5910)

Co-authored-by: Cycloctane <Cycloctane@outlook.com>
2025-10-06 13:11:49 +00:00
Miss Islington (bot)
bb1714016a
[3.13] gh-107194: Improved language of list.index in tutorial (gh-138518) (#138528)
Co-authored-by: Ric <11750904+ricsatjr@users.noreply.github.com>
2025-09-08 18:01:01 +03:00
Adam Turner
e7bb98a173
[3.13] GH-138465: Improve documentation for common sequence methods (GH-138474) (#138567)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-05 21:39:32 +00:00
Miss Islington (bot)
4e25f012e7
[3.13] gh-138307: Update the Ellipsis documentation (GH-138306) (#138439)
(cherry picked from commit 88665de120d7f89e18774b136f3c898bcfe52c7b)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-09-05 13:47:19 -07:00
Miss Islington (bot)
6587786270
[3.13] gh-138011: Clarify tutorial method object example code (GH-138014) (#138026)
x must be a MyClass instance for examples to work.

---------

(cherry picked from commit 339f5da6395868073e22157424405b89cafb5c6d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-08-21 12:40:15 -04:00
Miss Islington (bot)
e0ae4cbfc7
[3.13] gh-109975: Indicate the minimum version for PyREPL in the tutorial (GH-136046) (#137767)
Co-authored-by: Konstantin Morenko <konstantin-morenko@users.noreply.github.com>
2025-08-14 17:08:14 +01:00
Miss Islington (bot)
de1c5e4f56
[3.13] Pedantic rewording of why relative importing doesn't work in main modules (GH-136846) (#136941)
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 4b68289ca6954b8d135e2ee2344e67fae38239fd)

Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
2025-07-21 09:58:32 -07:00
Miss Islington (bot)
0a8fbb3677
[3.13] Update tutorial for new "Copy" button (GH-135007) (#135271)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-06-08 17:13:34 +00:00
Miss Islington (bot)
705fa8a23f
[3.13] feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181) (#135211)
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 343182853f19a42c0ba8980d3104076a8c7bcfe7)

Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
2025-06-06 13:23:07 +00:00
Kattni
79f20f1191
[3.13] Docs: Add note to tutorial clarifying scope (GH-134534) (#134545)
(cherry picked from commit 742d5b5c5d75eae44c66a43ebfa24a4f286ea8a1)
2025-05-23 00:04:10 +03:00
Miss Islington (bot)
9c297690d5
[3.13] fix indent in controlflow.rst docs (GH-134008) (#134185)
fix indent in `controlflow.rst` docs (GH-134008)
(cherry picked from commit 4ce91871a9077fcf8806d6fd79bdb32af9587306)

Co-authored-by: Yongzi Li <1538321957@qq.com>
2025-05-18 16:27:09 +00:00
Miss Islington (bot)
c529870542
[3.13] gh-133881: add forward reference to list.sort() in lambda expression tutorial (GH-133910) (#134127)
gh-133881: add forward reference to `list.sort()` in lambda expression tutorial (GH-133910)
(cherry picked from commit c1c9ad1d5a62a591eb2f0f0d29f3fa02e0949f14)

Co-authored-by: Oleg Burnaev <51371645+Shepard2154@users.noreply.github.com>
2025-05-17 08:05:41 +00:00
Miss Islington (bot)
eefe7e22b8
[3.13] Doc: Allow translating a code block in the tutorial (GH-131353) (#133649)
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872d8ed030181e5d009ea64e8672a68ee)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 09:29:34 +00:00
Miss Islington (bot)
25ae2045a8
[3.13] gh-116666: Add "token" glossary term (GH-130888) (GH-131367)
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.)
(cherry picked from commit 30d52058493e07fd1d3efea960482f4001bd2f86)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-18 12:51:02 +01:00
Miss Islington (bot)
6c92424b94
[3.13] gh-122876: Fix "End of lines" typo (GH-125310) (#130315)
Co-authored-by: za <za@python.or.id>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-19 21:23:49 +02:00
Miss Islington (bot)
5d35d279a5
[3.13] gh-101100: amend references starting with !~ in gh-127054 (GH-127684) (#127692)
gh-101100: amend references starting with `!~` in gh-127054 (GH-127684)
(cherry picked from commit 77a61c0465c27c1c4ba7cddf4638d9ed75259671)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-06 14:19:08 +00:00
Miss Islington (bot)
26f1e88aae
[3.13] gh-101100: Fix Sphinx warnings about list methods (GH-127054) (#127511)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-12-02 13:57:40 +00:00
Miss Islington (bot)
7f263d4444
[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)
(cherry picked from commit 26ff32b30553e1f7b0cc822835ad2da8890c180c)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
2024-11-25 21:39:59 +00:00
Miss Islington (bot)
5f4218418b
[3.13] Prefer "similar" over "equivalent" in tutorial (GH-125343) (GH-125372)
Prefer "similar" over "equivalent" in tutorial (GH-125343)

In the datastructures tutorial doc, some operations are described as
"equivalent to" others. This has led to some user-confusion -- at
least in the Discourse forums -- about cases in which the operations
differ.

This change doesn't systematically eliminate the word "equivalent"
from the tutorial. It just substitutes "similar to" in several cases
in which "equivalent to" could mislead users into expecting exact
equivalence.
(cherry picked from commit 4a2282b0679bbf7b7fbd36aae1b1565145238961)

Co-authored-by: Stephen Rosen <sirosen@globus.org>
2024-10-30 13:33:20 -07:00
Miss Islington (bot)
210bd2a50d
[3.13] gh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681) (GH-126191)
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

---------

(cherry picked from commit a3443c0e22a8623afe4c0518433b28afbc3a6df6)

Co-authored-by: amaajemyfren <32741226+amaajemyfren@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 10:35:10 -07:00
Miss Islington (bot)
de9ff23ea1
[3.13] docs: restore an anchor to for/else (GH-126154) (#126159)
docs: restore an anchor to for/else (GH-126154)
(cherry picked from commit 2d9d10179ff3f13029bf4430e62c455a839987ca)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-10-30 08:16:33 +00:00
Miss Islington (bot)
f521142b47
[3.13] Fix a typo in `Doc/tutorial/errors.rst` exception output (GH-126001) (#126009)
Fix a typo in ``Doc/tutorial/errors.rst`` exception output (GH-126001)
(cherry picked from commit a78d5b32429e2399178ac838e0e62b2bd62c0af9)

Co-authored-by: Bogdana Vereha <bogdanap@github.com>
2024-10-26 15:32:37 +00:00
Miss Islington (bot)
ca9bbafb49
[3.13] gh-125615: Fix grammar nit in tutorial's interactive interpreter appendix (GH-125619)
Replace "without ... nor" with "with neither ... nor"

(cherry picked from commit aab3210271136ad8e8fecd927b806602c463e1f2)

Authored-by: Cornelius Roemer <cornelius.roemer@gmail.com>
2024-10-16 20:58:49 +00:00
Miss Islington (bot)
c9ead96249
[3.13] gh-125383: Update fib function comment for accuracy (GH-125386) (#125395)
gh-125383: Update `fib` function comment for accuracy (GH-125386)

`Doc/tutorial/controlflow.rst`: fix comment for `fib` function
(cherry picked from commit 283ea5f3b2b6a18605b8598a979afe263b0f21ce)

Co-authored-by: Wulian <xiguawulian@gmail.com>
2024-10-13 11:16:23 +00:00
Miss Islington (bot)
a314026cfe
[3.13] Doc: Fix a typo in "Function Examples" in the control-flow tutorial (GH-125338) (#125341)
Doc: Fix a typo in "Function Examples" in the control-flow tutorial (GH-125338)
(cherry picked from commit 5a074aab845f82f4a150c27b905dae05c337d381)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-10-12 00:45:50 +00:00
Alex Waygood
aa4da1e468
[3.13] gh-101100: Consolidate documentation on ModuleType attributes (#124709) (#125208)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Barry Warsaw <barry@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-09 20:03:30 +01:00
Miss Islington (bot)
12bb9ed279
[3.13] Docs: make a tutorial example more precise (GH-125066) (#125078)
(cherry picked from commit 6e3c70c61bf961e55e9912a31ca11f61c8e2cd0c)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-10-08 02:15:42 +01:00
Miss Islington (bot)
ac3e6f801b
[3.13] Docs: for for/else clarify that return or raise also skip the else (GH-124591) (#124659)
Docs: for for/else clarify that return or raise also skip the else (GH-124591)

(cherry picked from commit 5329d1b74a86b3a22ff36f7976bfe720ee06d10d)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-27 11:08:56 -07:00
Alex Waygood
9f2e6ca199
[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
Miss Islington (bot)
56467a66d2
[3.13] For-else deserves its own section in the tutorial (GH-123946) (#124564)
For-else deserves its own section in the tutorial (GH-123946)

* For-else deserves its own section in the tutorial

* remove mention of unrolling the loop

* Update Doc/tutorial/controlflow.rst



---------

(cherry picked from commit ffdc80e93d9d947531fa0123e5b392c6f1fd9136)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-25 17:10:15 -07:00
Miss Islington (bot)
72139f276e
[3.13] Update to 3.13 the output of exceptions raised (GH-123888) (#124055)
Update to 3.13 the output of exceptions raised (GH-123888)
(cherry picked from commit 39612103dd9894abf8c2ebbe2fc183d65f1b51b1)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-09-23 10:53:31 -07:00
Wei-Hsiang (Matt) Wang
9f5f2b7128
[3.13] gh-123492: Remove unnecessary :func: parentheses (gh-123493) (#123513) 2024-08-30 20:14:48 +03:00
Miss Islington (bot)
009f9efe65
[3.13] GH-109975: Copyedit 3.13 What's New: New Features (GH-122990) (#123032)
GH-109975: Copyedit 3.13 What's New: New Features (GH-122990)
(cherry picked from commit b106cf8d978b32b04a4394973b850ef2a62cbcc4)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2024-08-15 09:25:33 +00:00
Miss Islington (bot)
fcc7c4ea66
[3.13] gh-122944: Fix incorrect prompt strings in the Python Tutorial (GH-122949) (#122954)
gh-122944: Fix incorrect prompt strings in the Python Tutorial (GH-122949)

In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
(cherry picked from commit be90648fb2de58b148dcc7553a08ca646911baf2)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
2024-08-12 18:56:36 +00:00
Serhiy Storchaka
a45d9051ed
[3.13] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122012)
(cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
2024-07-19 09:13:08 +00:00
Miss Islington (bot)
4af9c05e78
[3.13] gh-120452: improve documentation about private name mangling (GH-120451) (#121715)
gh-120452: improve documentation about private name mangling (GH-120451)
(cherry picked from commit f4d6e45c1e7161878b36ef9e876ca3e44b80a97d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-07-13 15:21:30 +00:00
Miss Islington (bot)
f0788cb419
[3.13] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH-120347) (GH-120411)
* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae147e1e658bbc8d454f8c7b2c4dea31d1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-12 14:51:35 +00:00
Miss Islington (bot)
a2003bd195
[3.13] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (#120229)
(cherry picked from commit 225aab7f70d804174cc3a75bc04a5bb1545e5adb)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-06-07 13:53:35 +00:00
Miss Islington (bot)
edb6883ef3
[3.13] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130) (#119925)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-01 21:35:03 +00:00
Miss Islington (bot)
3f0198d927
[3.13] docs: fix a few typos identified by codespell (GH-119516) (#119570)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-26 08:20:37 +00:00
Miss Islington (bot)
11ca1d9d53
[3.13] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-119326)
GH-110383: Improve Tutorial for Input Ouput (GH-119230)

(cherry picked from commit 9db2fd7edaa9d03e8c649c3bb0e8d963233cde22)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-05-21 19:54:26 +02:00
Miss Islington (bot)
1bb3a9df1b
[3.13] gh-119078: Clarify venv tutorial (GH-119129) (GH-119142)
(cherry picked from commit 0f5e8bed636c2f29701e5a1965d1b088d33abbf0)
2024-05-18 13:06:23 +01:00
Miss Islington (bot)
8f31af68d0
[3.13] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118792)
(cherry picked from commit 05c2fe1acda9ea5a57061642c36e8b73bb4fbba4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-08 19:55:12 +00:00
Kerim Kabirov
a855f824a2
Remove Python 3.5 hardcoded version in the tutorial appendix (GH-117612) 2024-05-07 15:28:16 +02:00
Pablo Galindo Salgado
f27f8c790a
gh-111201: A new Python REPL (GH-111567)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-05 21:32:23 +02:00
Hugo van Kemenade
7d0be7aea5
Add 'The Python 2.3 Method Resolution Order' (#116435) 2024-04-15 13:01:15 +03:00