Commit Graph

151 Commits

Author SHA1 Message Date
Miss Islington (bot) f8b61c739b
[3.11] gh-81094: Refer to PEP 318 in compound_statements.rst (GH-113588) (#113644)
Co-authored-by: John D. McDonald <43117960+Rasputin2@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-01-02 08:45:51 +00:00
Alex Waygood f83087ce03
[3.11] gh-101100: Improve documentation on function attributes (#112933) (#113003)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-12 14:19:02 +02:00
Miss Islington (bot) f22cdecb19
[3.11] GH-101100: Fix reference warnings for ``__enter__`` and ``__exit__`` (GH-110112) (#111076)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-19 18:34:27 +03:00
Miss Islington (bot) 1b60244b97
[3.11] GH-101100: Fix reference warnings for ``__getitem__`` (GH-110118) (#111074)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-19 18:33:12 +03:00
Ezio Melotti eb492d32b6
[3.11] gh-110631: Fix reST indentation in `Doc/reference` (GH-110708) (#110741)
Fix wrong indentation in the Doc/reference dir..
(cherry picked from commit 41d8ec5a1b)
2023-10-12 02:01:48 +02:00
Serhiy Storchaka 6bde1b9f04
[3.11] gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) (GH-106952)
(cherry picked from commit fcc816dbff)
2023-07-21 14:48:30 +03:00
Miss Islington (bot) 4b11af058e
[3.11] GH-97950: Use new-style index directive ('builtin') (GH-104164) (#104221)
GH-97950: Use new-style index directive ('builtin') (GH-104164)

* Uncomment builtin removal in pairindextypes

* Use new-style index directive ('builtin') - C API

* Use new-style index directive ('builtin') - Extending

* Use new-style index directive ('builtin') - Library

* Use new-style index directive ('builtin') - Reference

* Use new-style index directive ('builtin') - Tutorial
(cherry picked from commit f5088006ca)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-06 07:14:37 +03:00
Miss Islington (bot) 6a970ae666
[3.11] GH-97950: Use new-style index directive ('statement') (GH-104162) (#104163)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 13:57:14 +03:00
Miss Islington (bot) c463796ba7
[3.11] GH-97950: Use new-style index directive ('object') (GH-104158) (#104159)
GH-97950: Use new-style index directive ('object') (GH-104158)

* Uncomment object removal in pairindextypes

* Use new-style index directive ('object') - C API

* Use new-style index directive ('object') - Library

* Use new-style index directive ('object') - Reference

* Use new-style index directive ('object') - Tutorial
(cherry picked from commit 6ab463684b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 13:14:16 +03:00
Miss Islington (bot) a9fcf01ed9
[3.11] GH-97950: Use new-style index directive ('keyword') (GH-104153) (#104155)
GH-97950: Use new-style index directive ('keyword') (GH-104153)

* Uncomment keyword removal in pairindextypes

* Use new-style index directive ('keyword') - Reference
(cherry picked from commit 33ca322c50)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 10:53:19 +02:00
Adam Turner 00563694bb
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154) 2023-05-04 11:39:15 +03:00
Irit Katriel 5386730cdd
[3.11] gh-103590: do not wrap a single exception raised from a try-except* (#104094) 2023-05-02 19:24:02 +01:00
Alex Waygood a4fcd06c50
[3.11] Fix duplicated words in the docs (#102644)
(cherry-picked from commit f6ca71a422)

With grep utility found some duplicated words

Co-authored-by: Виталий Дмитриев <vitaldmit@bk.ru>
2023-03-13 14:31:50 +00:00
Miss Islington (bot) 78eee76185
gh-102011: use sys.exception() instead of sys.exc_info() in docs where possible (GH-102012)
(cherry picked from commit 4d3bc89a3f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-02-21 03:06:20 -08:00
Miss Islington (bot) eba6b00953
[3.11] gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353) (#100704)
gh-81611: Improve `range` paragraph in 8.3 of language reference (GH-98353)
(cherry picked from commit 8b1f125121)

Co-authored-by: 4l4k4z4m <alakazamjoined@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-01-04 15:57:24 -05:00
Miss Islington (bot) 138c2e6f3f
[3.11] "Compound statement" docs: Fix with-statement step indexing (GH-100286) (GH-100300)
Back in commit 226e6e7d43
an item was added to the list, renumbering all the rest of the
items, but the forward-reference wasn't updated to match.
(cherry picked from commit f23236a92d)

Co-authored-by: Frank Dana <ferdnyc@gmail.com>
2022-12-16 11:01:24 -08:00
Miss Islington (bot) e0df94dc7c
Docs: Add 'as, match statement' to the index (GH-99001)
(cherry picked from commit 26720fffd0)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-11-02 19:22:41 -07:00
Miss Islington (bot) 0bc2cf9915
gh-98172: [doc] mention that except* handles naked exceptions (GH-98496)
(cherry picked from commit 8367ca136e)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-10-21 03:43:56 -07:00
Miss Islington (bot) 9b12084aca
gh-98172: Fix formatting in `except*` docs (GH-98173)
(cherry picked from commit 5ecf961640)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-10-11 09:22:04 -07:00
Miss Islington (bot) 1fa848ac39
gh-95975: Move except/*/finally ref labels to more precise locations (GH-95976)
* gh-95975: Move except/*/finally ref labels to more precise locations

* Add section headers to fix :keyword: role and aid navigation

* Move see also to the introduction rather than a particular subsection

* Fix other minor Sphinx syntax issues with except

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Suppress redundant link to same section for except too

* Don't link try/except/else/finally keywords if in the same section

* Format try/except/finally as keywords in modified sections

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit dcc82331c8)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-01 22:20:43 -07:00
Miss Islington (bot) ca7e78dc3a
GH-96359: Fix docs that claim int(0|1) doesn't match False (GH-96361)
(cherry picked from commit 3d3a86ed40)

Co-authored-by: Jonathan Oberländer <github@l3vi.de>
2022-08-29 00:13:28 -07:00
Miss Islington (bot) e99496e1c2
Fix async method reference links in `compound_stmts` docs (GH-94935)
(cherry picked from commit 79d2f549ad)

Co-authored-by: July Tikhonov <july.tikh@gmail.com>
2022-07-22 10:13:02 -07:00
Michał D 281f980d35
bpo-46033: Clarify for-statement execution (GH-30025)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-02 20:52:20 -04:00
Irit Katriel 45833b50f0
bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027) 2022-03-21 20:41:35 +00:00
Pablo Galindo Salgado 7fb94fd7a8
bpo-46725: Document starred expressions in for statements (GH-31481)
Automerge-Triggered-By: GH:pablogsal
2022-02-22 09:26:46 -08:00
Julien Palard bcafab849e
[doc]: Spotted errors while working on rstlint. (GH-30879)
Also ignored some `make suspicious` false positives while assuring
true positives were properly seen by rstlint.
2022-01-27 08:57:43 +01:00
Irit Katriel 9925e70e48
bpo-45292: [PEP-654] exception groups and except* documentation (GH-30158) 2022-01-06 19:05:34 +00:00
Raymond Hettinger a09bc3a404
bpo-46095: Improve SeqIter documentation. (GH-30316) 2022-01-01 10:37:26 -08:00
Arthur Milchior 32959108f9
bpo-45640: [docs] Tokens are now clickable (GH-29260)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 17:06:38 +01:00
Christophe Nanteuil 0bcc5ade9b
Fix class pattern docs to refer to class patterns (GH-28849) 2021-10-10 22:12:51 +08:00
Raymond Hettinger db91b058d5
bpo-45346: Keep docs consistent regarding true and false values (GH-28697) 2021-10-02 13:48:08 -05:00
Mohamad Mansour 8f943ca257
[codemod] Fix non-matching bracket pairs (GH-28473)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-22 01:09:00 +02:00
Jack DeVries 2693132292
bpo-44589: raise a SyntaxError when mapping patterns have duplicate literal keys (GH-27131) 2021-07-14 17:38:42 -07:00
Daniel Shahaf fe175a87ad
Doc: Fix ambiguous pronoun (GH-26037) 2021-05-13 23:27:06 -07:00
Ken Jin 53c91ac525
bpo-43977: Update pattern matching language reference docs (GH-25917)
* Update patma language reference with new changes to sequence and mapping

* update 3.10 whatsnew too
2021-05-13 22:31:28 -07:00
Terry Jan Reedy 3b200b2aa6
bpo-44025: Clarify when '_' is a keyword. (#25873)
In match statements, in case patterns and nowhere else.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 11:00:29 +02:00
Pablo Galindo b0544ba77c
bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490)
This reverts commits 044a1048ca and 1be456ae9d, adapting the code to changes that happened after it.
2021-04-21 12:41:19 +01:00
Ken Jin 37a5e22023
Use double quotes over single quotes for match statement grammar (GH-24943) 2021-04-12 10:03:20 -07:00
Saiyang Gou 1e051a21b7
bpo-39702: Remove dotted_name from decorator documentation (GH-25234) 2021-04-08 15:34:09 -07:00
Saiyang Gou 58d72cab89
bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) 2021-04-07 20:06:43 +01:00
Ken Jin 5143fd15b4
Update pattern matching docs for changes to the PEP (#25185)
See:
- https://github.com/python/peps/pull/1909 (__match_args__ must be a tuple)
- https://github.com/python/peps/pull/1908 (allow keyword patterns for int(x) etc.)
2021-04-06 09:03:00 -07:00
Daniel F Moisset a22bca6b1e
bpo-42128: Add documentation for pattern matching (PEP 634) (#24664)
This is a first edition, ready to go out with the implementation. We'll iterate during the rest of the period leading up to 3.10.0.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Brandt Bucher <brandt@python.org>
Co-authored-by: Raymond Hettinger <1623689+rhettinger@users.noreply.github.com>
Co-authored-by: Guido van Rossum <guido@python.org>
2021-02-28 20:08:38 -08:00
Pablo Galindo 7c8e0b0336
Document new parenthesized with statements (GH-24281) 2021-01-25 23:15:51 +00:00
Géry Ogam d515c610c6
bpo-35790: Correct the description of sys.exc_info() and add a code example (GH-11625) 2020-12-21 14:13:08 +01:00
Colin Watson c95f8bc270
bpo-42669: Document that `except` rejects nested tuples (GH-23822)
In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural.  For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:

    try:
        self.getInputValue()
        return True
    except (InputErrors, SomethingElse):
        return False

As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple.  However, the reference documentation was never updated to match this new restriction.  Make it clear that the definition is no longer recursive.

Automerge-Triggered-By: GH:ericvsmith
2020-12-20 10:24:10 -08:00
Nick Gaya 4b8cdfcb22
bpo-41879: Doc: Fix description of async for statement (GH-23548)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables.  This fix is relevant for version 3.7 onward.
2020-12-11 00:27:35 -08:00
Andre Delfino 8adf8d1ec4
[doc] Remove mention of async and await as soft keywords (GH-22144) 2020-10-12 14:52:30 +01:00
Batuhan Taskaya 044a1048ca
bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)
The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions.

For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
2020-10-06 13:03:02 -07:00
Victor Stinner 8af239eacf
bpo-41762: Fix usage of productionlist markup in the doc (GH-22281)
Use an unique identifier for the different grammars documented using
the Sphinx productionlist markup.

productionlist markups of the same grammar, like "expressions" or
"compound statements", use the same identifier "python-grammar".
2020-09-18 09:10:15 +02:00
Andre Delfino b9f6ac9d46
Stick with the phrase "default parameter value" (GH-21590) 2020-07-22 20:58:19 -03:00