summaryrefslogtreecommitdiffstats
path: root/Doc/reference
Commit message (Collapse)AuthorAgeFilesLines
* gh-143054: Disallow non-top-level Cut for now (GH-143622)Petr Viktorin3 days1-2/+11
| | | | | | | | | | | | | The behaviour of Cut in nested parentheses, Repeat, Opt, and similar is somewhat chaotic. Apparently even the academic papers on PEG aren't as clear as they could be. And it doesn't really matter. Python only uses top-level cuts. When that changes, we can clarify as much as necessary (and even change the implementation to make sense for what we'll need). Document that this is deliberately unspecified, and add a test to make sure any decision is deliberate, tested and documented.
* gh-128335: Make slice generic at runtime (#128336)James Hilton-Balfe4 days1-0/+6
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-41779: Allow defining any __slots__ for a class derived from tuple ↵Serhiy Storchaka10 days1-1/+2
| | | | (GH-141763)
* gh-69686: Remove untrue part of `__import__` replacement docs (#143261)Thanos2025-12-301-3/+1
| | | | | | | Remove untrue part of `__import__` replacement docs The original statement effectively says that replacing `__import__` at global scope affects import statements, and not only that, but only import statements within the rest of the executing module. None of that has been true since at least Python 2.7, I think. This was likely missed in python/cpython#69686.
* Python 3.15.0a3v3.15.0a3Hugo van Kemenade2025-12-161-1/+1
|
* typo fixes in docs (#142683)SYan2122025-12-141-1/+1
|
* Add missing comma to tuple in `except*` docs (#142395)dr-carlos2025-12-131-1/+1
|
* GH-65961: Stop setting `__cached__` on modules (GH-142165)Brett Cannon2025-12-111-27/+11
|
* GH-97850: Remove all uses and definitions of `load_module()` from importlib ↵Brett Cannon2025-12-101-16/+14
| | | | (#142205)
* gh-101100: Fix references to the set methods (GH-141857)Serhiy Storchaka2025-12-051-1/+1
|
* gh-135676: Reword the f-string (and t-string) section (GH-137469)Petr Viktorin2025-12-032-158/+221
| | | | | | | | 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. 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>
* gh-135676: Simplify docs on lexing names (GH-140464)Petr Viktorin2025-11-261-58/+103
| | | | | | | | | | | | | | | 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 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>
* gh-41779: Allow defining the __dict__ and __weakref__ __slots__ for any ↵Serhiy Storchaka2025-11-191-2/+6
| | | | class (GH-141755)
* Docs: replace an esoteric Von Neumann mention (#137598)Ned Batchelder2025-10-201-6/+2
| | | | | * Docs: replace an esoteric Von Neumann mention * oops, don't need to edit topics.py
* gh-66646: Explain __base__ attribute in the docs (GH-102554)Furkan Onder2025-10-201-0/+8
| | | Co-authored-by: Éric <merwok@netwok.org>
* gh-140065: Lexical analysis: Correct note about leading zeros in floating ↵Stan Ulbrych2025-10-151-2/+2
| | | | point numbers (GH-140066)
* gh-97914: Reword misleading sentence on conditional expressions (#139064)Irit Katriel2025-10-141-2/+3
| | | | | Co-authored-by: Gilles Peiffer <gilles.peiffer.yt@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-135676: Add a summary of source characters (GH-138194)Petr Viktorin2025-10-081-5/+71
| | | | | | | 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>
* gh-105812: Use the ``:deco:`` role in place of manual decorator markup (#139619)Adam Turner2025-10-051-2/+2
|
* gh-135944: Add a "Runtime Components" Section to the Execution Model Docs ↵Eric Snow2025-10-021-0/+186
| | | | | (gh-135945) The section provides a brief overview of the Python runtime's execution environment. It is meant to be implementation agnostic,
* Make sure the ``:keyword:`` role works for ``case`` (#138878)sobolevn2025-09-211-0/+1
|
* gh-135629: rewrite language reference section on except* to improve clarity ↵Irit Katriel2025-09-161-28/+32
| | | | (#136150)
* gh-138871: Clarify NameError exception in 'del' (#138881)Kian Eliasi2025-09-151-2/+2
|
* closes gh-138706: update Unicode to 17.0.0 (#138719)Benjamin Peterson2025-09-111-3/+3
|
* GH-138562: Remove ``sort()`` from the common sequence methods in the data ↵Adam Turner2025-09-101-5/+8
| | | | model (#138563)
* GH-101100: Remove some entries from ``nitpick_ignore`` (#138464)Adam Turner2025-09-081-2/+2
|
* gh-101100: Resolve reference warnings in reference/ (#138418)Adam Turner2025-09-082-13/+13
|
* GH-138465: Improve documentation for common sequence methods (#138474)Adam Turner2025-09-051-5/+6
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-138191: Document ``frame.f_generator`` in the data model (#138540)dbXD3202025-09-051-0/+7
| | | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-135676: Reword the Operators & Delimiters section(s) (GH-137713)Petr Viktorin2025-09-031-56/+51
| | | | Co-authored-by: Blaise Pabon <blaise@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* GH-101100: Resolve reference warnings in whatsnew/3.6.rst (#138411)Adam Turner2025-09-031-0/+3
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* GH-101100: Resolve reference warnings in whatsnew/3.7.rst (#138410)Adam Turner2025-09-031-0/+5
| | | Resolve reference warnings in whatsnew/3.7.rst
* gh-138297 Point link in docs for `finally` to try/else, instead of if/else ↵James Parrott2025-09-021-6/+8
| | | | | | | (#138298) Co-authored-by: Brian Schubert <brianm.schubert@gmail.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* gh-110936: Reorder string literal definition in Lexical Analysis (GH-138063)Stan Ulbrych2025-09-021-2/+2
|
* gh-137376: Add note on top-level `global` declarations (GH-137707)Petr Viktorin2025-08-211-2/+9
| | | Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
* Docs: Small clarity change for ``except*`` (#121073)Greg Stein2025-08-061-1/+1
| | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-132661: PEP 750 documentation: second pass (#137020)Adam Turner2025-08-041-34/+34
|
* gh-136843: Document how multiple inheritance works (#136844)Jelle Zijlstra2025-07-282-1/+119
| | | | Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Akuli <akuviljanen17@gmail.com>
* gh-135676: Lexical analysis: Reword String literals and related sections ↵Petr Viktorin2025-07-234-223/+460
| | | | | | | (GH-135942) 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>
* gh-132661: Document t-strings and `templatelib` (#135229)Dave Peck2025-07-222-6/+48
| | | | | | | 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>
* gh-135110: Fix misleading `generator.close()` documentation (GH-135152)Connor Denihan2025-06-261-2/+4
| | | | | | 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.
* Docs: Add cross-reference for `positional_item` in the `calls` ↵HarryLHW2025-06-251-1/+1
| | | | | productionlist (GH-129977) Add missing hyperlink for `positional_item`
* gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850)Petr Viktorin2025-06-183-55/+168
|
* gh-135171: Update documentation for the generator expression (GH-135351)Serhiy Storchaka2025-06-151-2/+3
| | | | | | | | | | | | | | * 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 Co-authored-by: Brian Skinn <brian.skinn@gmail.com> --------- Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
* gh-127833: Reword and expand the Notation section (GH-134443)Petr Viktorin2025-06-092-50/+128
| | | | | | | | | | | | | | | 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. 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>
* gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, ↵Eric V. Smith2025-05-261-1/+2
| | | | | | | and add a test to make sure we catch this error in the future. (#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.
* gh-119180: Updates to PEP 649/749 docs (#134640)Jelle Zijlstra2025-05-261-1/+13
| | | | | | | | | | | | | - 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. Co-authored-by: Emma Smith <emma@emmatyping.dev> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-134026: Fix grammar description of for statement (GH-134034)Yash Vijay2025-05-212-8/+8
|
* gh-127833: lexical analysis: Improve section on Names (GH-131474)Petr Viktorin2025-05-211-52/+76
| | | | Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Blaise Pabon <blaise@gmail.com>
* gh-119180: More documentation for PEP 649/749 (#133552)Jelle Zijlstra2025-05-111-1/+7
| | | | | The SC asked that the Appendix in PEP-749 be added to the docs. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>