Commit graph

1071 commits

Author SHA1 Message Date
Miss Islington (bot)
c9b2ec6c66
[3.14] gh-101100: Fix references to the set methods (GH-141857) (GH-142300)
gh-101100: Fix references to the set methods (GH-141857)
(cherry picked from commit 1d8f3ed2eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-12-05 16:33:35 +02:00
Miss Islington (bot)
5611e0809b
[3.14] gh-135676: Reword the f-string (and t-string) section (GH-137469) (GH-142227)
Much of the information was duplicated in stdtypes.rst; this PR keeps
lexical/syntactical details in Lexical Analysis and the evaluation & runtime
behaviour in Standard types, with cross-references between the two.
Since the t-string section only listed differences from f-strings, and the
grammar for the two is equivalent, that section was moved to Standard types
almost entirely.
(cherry picked from commit aea5531583)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-04 11:53:12 +01:00
Stan Ulbrych
79245a47ed
[3.14] gh-135676: Simplify docs on lexing names (GH-140464) (GH-142015)
This simplifies the Lexical Analysis section on Names (but keeps it technically correct) by putting all the info about non-ASCII characters in a separate (and very technical) section.

It uses a mental model where the parser doesn't handle Unicode complexity “immediately”, but:

- parses any non-ASCII character (outside strings/comments) as part of a name, since these can't (yet) be e.g. operators
- normalizes the name
- validates the name, using the xid_start/xid_continue sets

(cherry picked from commit 2ff8608b4d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Micha Albert <info@micha.zone>
Co-authored-by: KeithTheEE <kmurrayis@gmail.com>
2025-12-03 13:43:06 +01:00
Stan Ulbrych
52f15231f0
[3.14] Docs: replace an esoteric Von Neumann mention (GH-137598) (#141071)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-11-05 23:20:17 +02:00
Miss Islington (bot)
4215f7f519
[3.14] gh-66646: Explain __base__ attribute in the docs (GH-102554) (GH-140365)
(cherry picked from commit faa169afa0)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: Éric <merwok@netwok.org>
2025-10-21 09:06:49 +02:00
Miss Islington (bot)
231552c6f7
[3.14] gh-140065: Lexical analysis: Correct note about leading zeros in floating point numbers (GH-140066) (GH-140167)
(cherry picked from commit 1624c646b0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-16 09:50:01 +02:00
Miss Islington (bot)
b24b656a4e
[3.14] gh-97914: Reword misleading sentence on conditional expressions (GH-139064) (#140093)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Gilles Peiffer <gilles.peiffer.yt@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-10-14 08:28:12 +00:00
Miss Islington (bot)
1c1a0bdfdc
[3.14] gh-135676: Add a summary of source characters (GH-138194) (GH-139781)
(cherry picked from commit 59a6f9d8c5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Micha Albert <info@micha.zone>
Co-authored-by: KeithTheEE <kmurrayis@gmail.com>
2025-10-08 18:07:05 +02:00
Miss Islington (bot)
9eee7fe717
[3.14] gh-135944: Add a "Runtime Components" Section to the Execution Model Docs (gh-135945) (#139509)
gh-135944: Add a "Runtime Components" Section to the Execution Model Docs (gh-135945)

The section provides a brief overview of the Python runtime's execution environment.  It is meant to be implementation agnostic,
(cherry picked from commit 46a1f0a9ff)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-10-07 19:19:42 +01:00
Miss Islington (bot)
572e4332cf
[3.14] gh-135629: rewrite language reference section on except* to improve clarity (GH-136150) (#139059)
gh-135629: rewrite language reference section on except* to improve clarity (GH-136150)
(cherry picked from commit a651ec9524)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2025-10-07 19:14:16 +01:00
Adam Turner
b1fa3414b3
[3.14] gh-105812: Use the `:deco:` role in place of manual decorator markup (GH-139619) (#139627)
(cherry picked from commit 3195da0b1a)
2025-10-07 19:13:35 +01:00
Miss Islington (bot)
93f5e26d97
[3.14] gh-137376: Add note on top-level global declarations (GH-137707) (GH-138023)
(cherry picked from commit 9f05f98730)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-10-07 19:59:29 +02:00
Miss Islington (bot)
460ad1aa1b
[3.14] Make sure the `:keyword: role works for case` (GH-138878) (#139200)
Make sure the ``:keyword:`` role works for ``case`` (GH-138878)
(cherry picked from commit 848d926786)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-09-22 07:13:05 +01:00
Miss Islington (bot)
284ab76d4e
[3.14] gh-110936: Reorder string literal definition in Lexical Analysis (GH-138063) (#138373)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-09-16 16:56:17 +03:00
Miss Islington (bot)
5ddd72afd8
[3.14] gh-138871: Clarify NameError exception in 'del' (GH-138881) (#138903)
Co-authored-by: Kian Eliasi <kian.elbo@gmail.com>
2025-09-16 16:54:37 +03:00
Miss Islington (bot)
a36981598c
[3.14] GH-138562: Remove `sort()` from the common sequence methods in the data model (GH-138563) (#138760)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:23:53 +03:00
Miss Islington (bot)
15ca9c6816
[3.14] gh-135676: Reword the Operators & Delimiters section(s) (GH-137713) (#138457)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:22:56 +03:00
Miss Islington (bot)
500abc41e8
[3.14] Docs: Small clarity change for `except*` (GH-121073) (#137494)
Co-authored-by: Greg Stein <gstein@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-11 12:14:33 +03:00
Miss Islington (bot)
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 <9087854+AA-Turner@users.noreply.github.com>

* Update check-warnings.py

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-09 19:12:40 +03:00
Miss Islington (bot)
dee3428120
[3.14] gh-101100: Resolve reference warnings in reference/ (GH-138418) (#138680)
gh-101100: Resolve reference warnings in reference/ (GH-138418)
(cherry picked from commit 6831634eb7)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-09 19:11:09 +03:00
Miss Islington (bot)
75c2d9f7c4
[3.14] gh-138297 Point link in docs for finally to try/else, instead of if/else (GH-138298) (#138381)
Co-authored-by: James Parrott <80779630+JamesParrott@users.noreply.github.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-09-08 18:09:31 +03:00
Miss Islington (bot)
1e1bfe7bbe
[3.14] gh-138191: Document `frame.f_generator` in the data model (GH-138540) (#138553)
Co-authored-by: dbXD320 <devanshbaghla320@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-06 19:59:36 +03:00
Miss Islington (bot)
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 <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-06 08:51:48 +03:00
Miss Islington (bot)
28fcdda083
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.6.rst (GH-138411) (#138455)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-09-03 15:27:52 +00:00
Miss Islington (bot)
b0069f14af
[3.14] GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410) (#138423)
GH-101100: Resolve reference warnings in whatsnew/3.7.rst (GH-138410)

Resolve reference warnings in whatsnew/3.7.rst
(cherry picked from commit dd86fb4ba5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 06:26:29 +00:00
Miss Islington (bot)
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 <9087854+AA-Turner@users.noreply.github.com>
2025-08-16 09:21:29 +03:00
Miss Islington (bot)
4832ceaa78
[3.14] gh-135676: Lexical analysis: Reword String literals and related sections (GH-135942) (#137048)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-07-23 19:23:25 +03:00
Miss Islington (bot)
c59a60bdb4
[3.14] gh-132661: Document t-strings and templatelib (GH-135229) (#136974)
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: pauleveritt <pauleveritt@me.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-07-22 13:32:00 +03:00
Miss Islington (bot)
ad6c90f5ba
[3.14] gh-135110: Fix misleading generator.close() documentation (GH-135152) (GH-135985)
gh-135110: Fix misleading `generator.close()` documentation (GH-135152)

The documentation incorrectly stated that generator.close() 'raises' a
GeneratorExit exception. This was misleading because the method doesn't
raise the exception to the caller - it sends the exception internally
to the generator and returns None.
(cherry picked from commit 0d76dccc3b)

Co-authored-by: Connor Denihan <188690869+cdenihan@users.noreply.github.com>
2025-06-26 13:34:33 +00:00
Miss Islington (bot)
8ef0398238
[3.14] Docs: Add cross-reference for positional_item in the calls productionlist (GH-129977) (GH-135940)
Docs: Add cross-reference for `positional_item` in the `calls` productionlist (GH-129977)

Add missing hyperlink for `positional_item`
(cherry picked from commit d2154912b3)

Co-authored-by: HarryLHW <123lhw321@gmail.com>
2025-06-25 14:30:42 +00:00
Miss Islington (bot)
bb9927005f
[3.14] gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850) (GH-135677)
gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850)
(cherry picked from commit 21f3d15534)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-18 14:40:28 +00:00
Miss Islington (bot)
ee141f0277
[3.14] gh-135171: Update documentation for the generator expression (GH-135351) (#135524)
gh-135171: Update documentation for the generator expression (GH-135351)

* gh-135171: Update documentation for the generator expression

Document that the iterator for the leftmost "for" clause is created
immediately.

* Update Doc/reference/expressions.rst



---------
(cherry picked from commit 8979d3afe3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
2025-06-15 00:38:19 +00:00
Miss Islington (bot)
8b35651853
[3.14] gh-127833: Reword and expand the Notation section (GH-134443) (GH-135301)
Prepare the docs for using the notation used in the `python.gram`
file. If we want to sync the two, the meta-syntax should be the same.

Link the Full Grammar docs here; keep only a few extras.

Also, remove the distinction between lexical and syntactic rules,
except for whitespace handling.
With f- and t-strings, the line between the two is blurry.
(cherry picked from commit 28d91d06f1)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
2025-06-09 13:56:24 +00:00
Miss Islington (bot)
74f5667bd9
[3.14] gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (GH-134734) (#134739)
gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (GH-134734)

* Add t-string prefixes to _all_string_prefixes, and add a test to make sure we catch this error in the future.

* Update lexical analysis docs for t-string prefixes.
(cherry picked from commit 08c78e02fa)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-05-26 15:24:24 -04:00
Miss Islington (bot)
9ddc7c548d
[3.14] gh-119180: Updates to PEP 649/749 docs (GH-134640) (#134731)
gh-119180: Updates to PEP 649/749 docs (GH-134640)

- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.
(cherry picked from commit 7291eaba8b)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2025-05-26 15:40:43 +00:00
Miss Islington (bot)
ebfd18b3f0
[3.14] gh-127833: lexical analysis: Improve section on Names (GH-131474) (#134423)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-05-26 11:00:17 +03:00
Miss Islington (bot)
6ea83e077e
[3.14] gh-134026: Fix grammar description of for statement (GH-134034) (GH-134424)
gh-134026: Fix grammar description of for statement (GH-134034)
(cherry picked from commit 4eacf3883d)

Co-authored-by: Yash Vijay <yash_vijay@outlook.com>
2025-05-21 18:43:07 +02:00
Miss Islington (bot)
a3475e68bb
[3.14] gh-119180: More documentation for PEP 649/749 (GH-133552) (#133902)
gh-119180: More documentation for PEP 649/749 (GH-133552)

The SC asked that the Appendix in PEP-749 be added to the docs.
(cherry picked from commit 3396df56d0)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-11 15:49:06 +00:00
Miss Islington (bot)
a020336256
[3.14] gh-127833: Add links to token types to the lexical analysis intro (GH-131468) (#133652)
gh-127833: Add links to token types to the lexical analysis intro (GH-131468)
(cherry picked from commit 45bb5ba61a)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-08 10:46:47 +01:00
Miss Islington (bot)
ca3e3b8a27
[3.14] gh-127833: lexical analysis: Add backticks to BOM example (GH-132407) (#133632)
gh-127833: lexical analysis: Add backticks to BOM example (GH-132407)
(cherry picked from commit 0552ce0fb2)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-08 01:40:41 +00:00
Hugo van Kemenade
b092705907 Python 3.14.0b1 2025-05-06 18:33:52 +03:00
Jelle Zijlstra
7cb86c5def
gh-132426: Add get_annotate_from_class_namespace replacing get_annotate_function (#132490)
As noted on the issue, making get_annotate_function() support both types and
mappings is problematic because one object may be both. So let's add a new one
that works with any mapping.

This leaves get_annotate_function() not very useful, so remove it.
2025-05-04 07:26:42 -07:00
Inada Naoki
b1f2304b20
doc: update co_flags reference (#132300)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-24 14:05:56 +00:00
Serhiy Storchaka
62ff86fa55
gh-130104: Call __rpow__ in ternary pow() if necessary (GH-130251)
Previously it was only called in binary pow() and the binary
power operator.
2025-04-16 18:32:41 +03:00
Hugo van Kemenade
29af6cee02 Python 3.14.0a7 2025-04-08 14:20:51 +03:00
Pablo Galindo Salgado
c2ac662f28
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833) 2025-04-01 19:04:56 +00:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
8b7d20d3a9
gh-131457: Fix typo in BNF description of function signatures (#131460) 2025-03-22 10:54:48 +03:00
Petr Viktorin
4bced29a74
gh-130587: Add hand-written docs for non-OP tokens (GH-130588)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2025-03-19 16:42:11 +01:00
Irit Katriel
ffc2f1dd1c
gh-130080: implement PEP 765 (#130087) 2025-03-17 20:48:54 +00:00
Petr Viktorin
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 <9087854+AA-Turner@users.noreply.github.com>
2025-03-17 17:05:47 +01:00