Commit graph

988 commits

Author SHA1 Message Date
Miss Islington (bot)
d263bc742a
[3.12] gh-126664: revert: Use else instead of finally in docs explaining "with" (GH-128169) (#128171)
gh-126664: revert: Use `else` instead of `finally` in docs explaining "with" (GH-128169)

Revert "gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)"

This reverts commit 25257d61cf.
(cherry picked from commit 228f275737)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-12-24 10:56:03 -08:00
Carol Willing
9295a1d033
[3.12] Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720) (#126891)
* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks
(cherry picked from commit 94a7a4e22f)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2024-12-02 14:55:31 +01:00
Miss Islington (bot)
d79acd96e0
[3.12] Document that return-less user-defined functions return None (GH-126769) (#126823)
Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f1165)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-11-14 10:46:26 +01:00
Miss Islington (bot)
fb82e10ce4
[3.12] gh-126664: Use else instead of finally in "The with statement" documentation. (GH-126665) (#126671)
gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)
(cherry picked from commit 25257d61cf)

Co-authored-by: vivodi <103735539+vivodi@users.noreply.github.com>
2024-11-11 06:57:15 +00:00
Miss Islington (bot)
61e6f0992f
[3.12] Postpone module.__loader__ deprecation to Python 3.16 (GH-126482) (#126637)
Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482)
(cherry picked from commit 450db61a78)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-10 00:57:54 +00:00
Hugo van Kemenade
94423b6be1
[3.12] gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (GH-126392) (#126404)
(cherry picked from commit eac41c5ddf)
2024-11-04 19:47:40 +02:00
Miss Islington (bot)
bda8190b89
[3.12] gh-60712: Include the "object" type in the lists of documented types (GH-103036) (GH-126198)
gh-60712: Include the "object" type in the lists of documented types (GH-103036)

* add test for the predefined object's attributes

* Include the "object" type in the lists of documented types

* remove 'or' from augment tuple

* 📜🤖 Added by blurb_it.

* Add cross-reference to news



* Fix format for the function parameter



* Add space



* add reference for the 'object'



* add reference for NotImplemented



* Change ref:`string <textseq>`  as class:`str`



* remove hyphen from `newly-created`

* Update Doc/reference/datamodel.rst

'dictionaries' to 'dict'



* Update predefined attribute types in testPredefinedAttrs

* Change `universal type` as `top type`

* Don't mention about the top type

* Update the description of richcmpfuncs

* Update Doc/library/stdtypes.rst



* Revert: Hierarchy Section in Data Model Documentation

* Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.

* Update Doc/reference/datamodel.rst



* Remove blank line



* Use ref:`str <textseq>` instead of :class:`str



* Revert changes the description of Other Built-in Types in stdtypes.rst

* Update Doc/reference/datamodel.rst



---------

(cherry picked from commit 4f826214b3)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-10-30 13:15:24 -07:00
Miss Islington (bot)
f1a6f68777
[3.12] gh-125461: Remove Python 2 from identifiers in doc (GH-125462) (#125465)
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)

Remove Python 2 from identifiers in doc
(cherry picked from commit 5dac0dceda)

Co-authored-by: Paul Hoffman <phoffman@proper.com>
2024-10-14 08:49:56 -07:00
Alex Waygood
cba37762ac
[3.12] gh-101100: Consolidate documentation on ModuleType attributes (#124709) (#125211)
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 19:18:38 +00:00
Miss Islington (bot)
c6f3f83d88
[3.12] gh-115528: Update language reference for PEP 646 (GH-121181) (#124633)
gh-115528: Update language reference for PEP 646 (GH-121181)

To recap: the objective is to make starred expressions valid in `subscription`,
which is used for generics: `Generic[...]`, `list[...]`, etc.

What _is_ gramatically valid in such contexts? Seemingly any of the following.
(At least, none of the following throw `SyntaxError` in a 3.12.3 REPL.)

    Generic[x]
    Generic[*x]
    Generic[*x, y]
    Generic[y, *x]
    Generic[x := 1]
    Generic[x := 1, y := 2]

So introducting

    flexible_expression: expression | assignment_expression | starred_item

end then switching `subscription` to use `flexible_expression` sorts that.

But then we need to field `yield` - for which any of the following are
apparently valid:

    yield x
    yield x,
    yield x, y
    yield *x,
    yield *x, *y

Introducing a separate `yield_list` is the simplest way I've been figure out to
do this - separating out the special case of `starred_item ,`.

(cherry picked from commit 7d3497f617)

Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-09-26 13:03:28 -07:00
Jelle Zijlstra
d4cd39097e
[3.12] gh-101100: Make __subclasses__ doctest stable (GH-124577) (#124580)
Using a standard library class makes this test difficult to maintain
as other tests and other parts of the stdlib may create subclasses,
which may still be alive when this test runs depending on GC timing.
(cherry picked from commit 08a467b537)
2024-09-26 06:40:40 +00:00
Jelle Zijlstra
7ce138fa9b
[3.12] gh-123242: Note that type.__annotations__ may not exist (GH-124557) (#124562)
Closes GH-123242. The real criterion is that the attribute does not
exist on heap types, but I don't think we should discuss heap vs.
static types in the language reference.
(cherry picked from commit 99b23c64de)
2024-09-25 16:27:10 -07:00
Alex Waygood
d2068c65a6
[3.12] gh-101100: Add a table of class attributes to the "Custom classes" section of the data model docs (#124480) (#124558) 2024-09-25 23:01:19 +00:00
Miss Islington (bot)
92bc714033
[3.12] GH-103484: Fix permanently redirects reported by linkcheck (GH-124144) (GH-124152)
Fix redirects reported by linkcheck, update docs conf.py checks.
(cherry picked from commit 0a32c6959c)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-09-16 20:53:46 -07:00
Miss Islington (bot)
c6ee0b3e7b
[3.12] gh-123580: Fix signed_number token in documentation (GH-123582) (GH-123624)
gh-123580: Fix `signed_number` token in documentation (GH-123582)

(cherry picked from commit 9e079c220b)

Co-authored-by: CBerJun <121291537+CBerJun@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-09-04 11:19:29 +02:00
Miss Islington (bot)
252ed6da4d
[3.12] gh-123621: Fix datamodel.rst with proper dict notation (GH-123648) (#123654)
gh-123621: Fix `datamodel.rst` with proper `dict` notation (GH-123648)
(cherry picked from commit cfbc841ef3)

Co-authored-by: Lipták Attila (Flash) <113017309+AttilaLiptak@users.noreply.github.com>
2024-09-03 20:00:53 +00:00
Miss Islington (bot)
acb19be799
[3.12] gh-123579: Document exclamation token (GH-123612) (#123638)
(cherry picked from commit 68fe5758bf)

Co-authored-by: Shaygan Hooshyari <sh.hooshyari@gmail.com>
2024-09-03 14:56:19 +00:00
Wei-Hsiang (Matt) Wang
d47d7e1124
[3.12] gh-123517: Remove unnecessary :meth: parentheses (gh-123518) (GH-123576) 2024-09-02 16:02:39 +02:00
Wei-Hsiang (Matt) Wang
d5abd02f36
[3.12] gh-123492: Remove unnecessary :func: parentheses (gh-123493) (#123512) 2024-08-30 20:09:55 +03:00
Miss Islington (bot)
92ad3be09b
[3.12] gh-122701: Fix wording of raw strings/bytes in lexical_analysis.rst (GH-122702) (#122915)
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (GH-122702)
(cherry picked from commit ea70439bd2)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-11 21:09:13 +00:00
Miss Islington (bot)
13c263c444
[3.12] gh-122511: Improve documentation for object identity of mutable/immutable types (GH-122512) (#122779)
gh-122511: Improve documentation for object identity of mutable/immutable types (GH-122512)
(cherry picked from commit 76bdeebef6)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-07 14:56:40 +01:00
Miss Islington (bot)
1cd57b9937
[3.12] Remove outdated note about instance methods from datamodel.rst (GH-122471) (#122480)
Remove outdated note about instance methods from datamodel.rst (GH-122471)
(cherry picked from commit c68cb8e0c9)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2024-07-30 19:48:29 +00:00
Serhiy Storchaka
39dea212f4
[3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013)
(cherry picked from commit 1a0c7b9ba4)
2024-07-19 09:08:33 +00:00
Miss Islington (bot)
20d145512a
[3.12] gh-120452: improve documentation about private name mangling (GH-120451) (#121716)
gh-120452: improve documentation about private name mangling (GH-120451)
(cherry picked from commit f4d6e45c1e)

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:11:33 +00:00
Miss Islington (bot)
8d3f44ad01
[3.12] gh-121355: Fix incorrect word in simple_stmts.rst (GH-121356) (#121363)
(cherry picked from commit 715ec630dd)

Co-authored-by: Jongbum Won <71166964+Wondaeng@users.noreply.github.com>
2024-07-04 13:43:31 +00:00
Miss Islington (bot)
b93386e1c4
[3.12] gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175) (#121235)
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175)
(cherry picked from commit 91313afdb3)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
2024-07-01 16:41:18 +00:00
Miss Islington (bot)
21a953613c
[3.12] doc: Mention the missing reflected special methods for all binary operations (GH-119931) (#120064)
doc: Mention the missing reflected special methods for all binary operations (GH-119931)
(cherry picked from commit bf5e1065f4)

Co-authored-by: Paulo Freitas <me@paulofreitas.me>
2024-06-29 12:12:46 +05:30
Miss Islington (bot)
709ef004df
[3.12] gh-120937: Reference weakref from the __del__ documentation (GH-120940) (#121062)
gh-120937: Reference weakref from the `__del__` documentation (GH-120940)
(cherry picked from commit 1c13b29d54)

Co-authored-by: chaen <christophe.haen@cern.ch>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-26 20:14:30 +00:00
Miss Islington (bot)
ae9b54bd48
[3.12] gh-120521: clarify except* documentation to allow tuples (GH-120523) (#120751)
(cherry picked from commit 58b3f11176)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 12:06:52 -07:00
Miss Islington (bot)
5185951335
[3.12] annotations: expand documentation on "simple" assignment targets (GH-120535) (#120556)
This behavior is rather surprising and it was not clearly specified.

(cherry picked from commit 9e0b11eb21)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 15:24:21 +00:00
Miss Islington (bot)
045be7729e
[3.12] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364) (#119870)
gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fdd0a)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-31 18:24:11 +01:00
Miss Islington (bot)
4d85f0ae76
[3.12] Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (GH-114009) (#118128)
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (GH-114009)
(cherry picked from commit 1558d99316)

Co-authored-by: Quazi Irfan <quazirfan@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-21 01:50:01 +00:00
Hugo van Kemenade
a844e83b06
[3.12] Add 'The Python 2.3 Method Resolution Order' (GH-116435) (#117885)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-15 14:14:16 +03:00
Miss Islington (bot)
9359fdd6fa
[3.12] Add information about negative indexes to sequence datamodel doc (GH-110903) (#117238)
Co-authored by Terry Jan Reedy
(cherry picked from commit c2276176d5)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-03-25 22:40:28 +00:00
Miss Islington (bot)
05b2b30436
[3.12] gh-56374: Clarify documentation of nonlocal (GH-116942) (#117023)
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc.  Add "Programmer's note".

(cherry picked from commit 025ef7a5f7)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-19 18:05:27 +00:00
Miss Islington (bot)
1627c1ee01
[3.12] gh-107607: Update comment about utf-8 BOM being ignored (GH-107858) (#117016)
(cherry picked from commit 7f64ae30dd)
Co-authored-by: Terry Jan Reedy tjreedy@udel.edu
2024-03-19 12:00:40 -04:00
Miss Islington (bot)
6383b14957
[3.12] gh-116881: Remove erroneous or redundant grammar NULL (GH-116885) (#116951)
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'.  In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>.  Remove it there.
(cherry picked from commit 4e45c6c54a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-03-18 10:37:26 -04:00
Serhiy Storchaka
1e75fe1468
[3.12] gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298) (GH-116450)
(cherry picked from commit 808a77612f)
2024-03-07 08:21:25 +00:00
Miss Islington (bot)
5b73ed4b66
[3.12] gh-72971: Clarify the special no-TypeError behavior for equality (GH-110729) (#116254)
(cherry picked from commit 67f742e03a)

Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
2024-03-03 01:55:59 +01:00
Miss Islington (bot)
694874b7dc
[3.12] gh-104219: Document that idunders can return NotImplemented (GH-104220) (#116210)
(cherry picked from commit 2713c2abc8)

Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-03-01 16:08:59 +00:00
Miss Islington (bot)
240e5f613b
[3.12] Docs: mark up NotImplemented using the :data: role throughout the docs (GH-116135) (#116147)
(cherry picked from commit dbe44f150c)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-02-29 20:53:51 +00:00
Miss Islington (bot)
59ec6e8f23
[3.12] Erase some unnecessary quotes on data model doc (GH-113521) (#115896)
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.

(cherry picked from commit f7455864f2)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2024-02-24 23:30:14 -05:00
Kirill Podoprigora
ae6c01d9d2
[3.12] gh-115572: Move codeobject.replace() docs to the data model … (#115633)
* [3.12] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4c14)

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>

* Remove note about copy.replace

---------

Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
2024-02-18 14:38:33 +00:00
Miss Islington (bot)
c2a3c3c643
[3.12] gh-115405: add versionadded tag for co_qualname in code objects documentation (GH-115411) (#115412)
gh-115405: add versionadded tag for co_qualname in code objects documentation (GH-115411)
(cherry picked from commit de07941729)

Co-authored-by: Christophe Papazian <114495376+christophe-papazian@users.noreply.github.com>
2024-02-13 16:16:22 +00:00
Miss Islington (bot)
7cc205872d
[3.12] gh-114552: Update __dir__ method docs: it allows returning an iterable (GH-114662) (#115234)
gh-114552: Update `__dir__` method docs: it allows returning an iterable (GH-114662)
(cherry picked from commit e19103a346)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-02-10 08:50:31 +00:00
Miss Islington (bot)
b3d01fc56d
[3.12] Clarify one-item tuple (GH-114745) (#114757)
A 'single tuple' means 'one tuple, of whatever length.
Remove the unneeded and slightly distracting parenthetical 'singleton' comment.
(cherry picked from commit a1332a99cf)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-30 18:50:28 +00:00
Miss Islington (bot)
01910d6845
[3.12] gh-101100: Fix sphinx warnings in reference/import.rst (GH-114646) (#114652)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-27 09:37:08 -07:00
Miss Islington (bot)
f9979212f8
[3.12] gh-101100: Fix Sphinx warnings in reference/expressions.rst (GH-114194) (#114436)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-22 18:50:20 +02:00
Miss Islington (bot)
f7d5d936ab
[3.12] Fix the confusing "User-defined methods" reference in the datamodel (GH-114276) (#114365) 2024-01-21 03:52:04 +00:00
Miss Islington (bot)
74a6b7f639
[3.12] gh-114070: fix token reference warnings in expressions.rst (GH-114169) (#114192)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-01-17 16:46:02 +00:00