791 Commits

Author SHA1 Message Date
Miss Islington (bot)
ce93371488
[3.9] [3.11] Add single value agen.athrow(value) signature to the 3.11 docs gh-105269 (GH-105468) (#105477)
(cherry picked from commit acf3916e84158308660ed07c474a564e045d6884)

Co-authored-by: Federico Caselli <CaselIT@users.noreply.github.com>
2023-07-05 13:18:49 +02:00
Miss Islington (bot)
9f7cdb2cf7
bpo-45393: help() on operator precedence has misleading entries (GH-31246) (GH-92967)
(cherry picked from commit fb082c2fc5a925085b179e63ca10b7f60b356d2f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-05-19 17:33:09 +02:00
Miss Islington (bot)
4d05114ae7
gh-80143: Add clarification for escape characters (GH-92292) (GH-92630)
(cherry picked from commit 549567c6e70da4846c105a18a1a89e7dd09680d7)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-16 17:32:28 +02:00
Miss Islington (bot)
696d868d19
gh-87304: Improve comments in language reference for imports (GH-92164)
(cherry picked from commit ee2205b208389611e8a278ac1bc74b34f4994fd2)

Co-authored-by: Robert Yang <35813883+robert861212@users.noreply.github.com>
2022-05-03 15:28:09 -07:00
Miss Islington (bot)
3537d897e0
gh-89885: Improve import example in language reference (GH-91523) (#91649)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit d5a69571f586080af4c29671c47f9c4bc671af7f)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-17 14:51:19 -07:00
Miss Islington (bot)
b5092350b2
Language reference: Remove duplicated text about iterable unpacking (GH-25212)
(cherry picked from commit 4f5d56f8f33196f5ed8ffad0ab2f012afda2f9b3)

Co-authored-by: Jiashuo Li <4003950+jiasli@users.noreply.github.com>
2022-04-02 20:06:54 -07:00
Miss Islington (bot)
f4e280d8c5
bpo-24563: Link encoding names to encoding declarations (GH-32274)
(cherry picked from commit 01be5d6446abbdd95d0c18bd19a58a62b05568d8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-04-02 17:40:31 -07:00
Miss Islington (bot)
98d57737de
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 8be7c2bc5ad5e295f0f855bb31db412eef2c7c92)

Co-authored-by: Dave Goncalves <davegoncalves@gmail.com>
2022-03-31 07:24:39 -07:00
Irit Katriel
2d5e9f8d62
bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type (GH-32027) (GH-32035)
(cherry picked from commit 45833b50f0ccf2abb01304c900afee05b6d01b9e)
2022-03-21 21:27:53 +00:00
Miss Islington (bot)
504973a133
bpo-46013: Fix confusing kerning on period in docs (GH-29989) (GH-32006)
(cherry picked from commit 3af68fc77c528d4e7749046cf6e41fd79902e6e6)

Co-authored-by: jmcb <joel.mcbride1@live.com>

Co-authored-by: jmcb <joel.mcbride1@live.com>
2022-03-20 12:18:02 +00:00
Miss Islington (bot)
f8c3697aca
Removed confusing reference to sys (GH-31638)
(cherry picked from commit 28f84c72b6cee145f9c00e9b999656e9a2517e49)

Co-authored-by: David Gilbertson <gilbertson.david@gmail.com>
2022-03-08 08:08:24 -08:00
Miss Islington (bot)
89c360125b
Removed ambiguity in __init_subclass__ docs (GH-31540)
(cherry picked from commit ab014978aef303ac60465c9010505d798dc34df8)

Co-authored-by: David Gilbertson <gilbertson.david@gmail.com>
2022-03-07 20:40:16 -08:00
Miss Islington (bot)
e83f084084
bpo-45680: Improve docs on subscriptions w.r.t. GenericAlias objects (GH-29479)
(cherry picked from commit 50731297a9b6d57eec3b3f89522785b23f7b3e71)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-07 20:15:55 -08:00
Miss Islington (bot)
1440dd3438
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236)
(cherry picked from commit 08c0ed2d9c0d01ad1a5adc0787bc75e4e90cbb85)

Co-authored-by: Kinshuk Dua <kinshukdua@gmail.com>
2022-01-27 02:50:43 -08:00
Miss Islington (bot)
8bc68140cb
bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663)
(cherry picked from commit 273cb8e7577d143830404f6779946a0bedb58758)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2022-01-07 11:00:45 -08:00
Miss Islington (bot)
8bfb11a791
bpo-46076: Improve documentation for per-attribute docstrings with __slots__ (GH-30109) (GH-30207) 2021-12-19 15:11:37 -06:00
Alex Waygood
2029c58097
[3.9] bpo-45840: Improve cross-references in the data model documentation (GH-29633) (GH-30081)
Backport of GH-29633 to the 3.9 branch
2021-12-13 14:19:08 +02:00
Miss Islington (bot)
81a38293f2
[doc] Clarify MRO precedence in descriptor super binding section (GH-29539) (GH-29670)
A similar sentence is present in the 'Invocation from super' section of
the descriptor HOWTO, where it is already correct.
(cherry picked from commit ee49484c0f0d0d79e8fc40835da10b78f89ae503)

Co-authored-by: Jouke Witteveen <j.witteveen@gmail.com>
2021-12-11 01:01:35 +01:00
Miss Islington (bot)
591bf41609
[3.9] [doc] bpo-45680: Disambiguate `__getitem__ and __class_getitem__` in the data model (GH-29389) (GH-29619)
The documentation explaining Python's data model does not adequately explain
the differences between ``__getitem__`` and ``__class_getitem__``, nor does it
explain when each is called. There is an attempt at explaining
``__class_getitem__`` in the documentation for ``GenericAlias`` objects, but
this does not give sufficient clarity into how the method works. Moreover, it
is the wrong place for that information to be found; the explanation of
``__class_getitem__`` should be in the documentation explaining the data model.

This PR has been split off from GH-29335.
(cherry picked from commit 31b3a70edb1216bdc8fab3b2eafd8ddb00487f41)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 18:41:09 +01:00
Miss Islington (bot)
3767e0d943
bpo-45583: Correct datamodel documentation of int() (GH-29182) (GH-29286)
It should be noted that this part of the documentation is redundant with
function.rst's documentation of int. This one was correctly updated with Python 3.8.
(cherry picked from commit d9c1868c25ec6466e8d8ae21fe9315a8a03836ab)

Co-authored-by: Arthur Milchior <arthur@milchior.fr>
2021-10-28 22:17:20 +02:00
Miss Islington (bot)
ac1b7a3319
[3.9]bpo-45463: Clarify that global statements allows multiple names (GH-28851) (GH-28990)
The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.htmlGH-the-global-statement).

The "Execution model" chapter described the global statement as if it
only allowed one single name. Pluralize "name" in the appropriate places.
(cherry picked from commit 4ecd119b007cb766b8bede2dc78b70d29cd932dd)

Co-authored-by: Luca Chiodini <luca@chiodini.org>

Co-authored-by: Luca Chiodini <luca@chiodini.org>
2021-10-16 10:01:14 -04:00
Łukasz Langa
68223cd12f
[3.9] [docs] Improve the markup of powers (GH-28598) (GH-28608)
(cherry picked from commit 4f05f15d7b25ef8b690cb94fdc4c8cb5521a4e27)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-28 23:13:16 +02:00
Łukasz Langa
5482db5800
[3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)
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>.
(cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29)

Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
2021-09-22 17:32:04 +02:00
Miss Islington (bot)
b1f2fe777e
bpo-45104: Clarify when __init__ is called (GH-28210) (GH-28212)
(cherry picked from commit fa15df77f02ba4a66ba0b71989381a426038be01)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-09-07 18:27:28 +02:00
Miss Islington (bot)
46970fdd8d
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) (GH-27962)
(cherry picked from commit 806e25fd3173a80021e6df87b81263b5f6056f38)

Co-authored-by: Objectivitix <79152594+Objectivitix@users.noreply.github.com>
2021-08-26 10:03:18 +03:00
Miss Islington (bot)
b57011d2a5
bpo-41911: Update docs for various expressions (GH-27470) (GH-27491)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 4bd9caafb64589288e5171087070bde726178c58)

Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
2021-07-30 19:25:58 +02:00
Miss Islington (bot)
11b5045b0c
bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513) (GH-26238)
Clarify ``getattr`` and ``setattr`` requirements for accessing name-mangled attributes

Co-Authored-By: Catalin Iacob <iacobcatalin@gmail.com>
(cherry picked from commit 2edaf6a4fb7e20324dde1423232f07211347f092)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-22 12:06:46 +01:00
Miss Islington (bot)
f3007ea9ad
Update doc as relative import can be used with star import (GH-25667) (GH-26122)
(cherry picked from commit 3d4b5f1019123a7d74801500eb18ec8fa12136bc)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2021-05-14 07:25:40 -07:00
Steve Dower
bb2f3ff7a8
bpo-42800: Add audit events for f_code and tb_frame (GH-24182)
Accessing the following attributes will now fire PEP 578 style audit hooks as (object.__getattr__, obj, name):
* PyTracebackObject: tb_frame
* PyFrameObject: f_code
* PyGenObject: gi_code, gi_frame
* PyCoroObject: cr_code, cr_frame
* PyAsyncGenObject: ag_code, ag_frame
2021-05-03 14:06:36 +01:00
Miss Islington (bot)
e60b1e150d
bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805) (GH-25819) 2021-05-02 13:14:30 -07:00
Miss Islington (bot)
ab99b6a8ba
Fix a typo in datamodel reference document (GH-24930)
(cherry picked from commit a1a5e3c4c83c3e3fe24c96ae22dfdedc7e23a1bb)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2021-04-25 14:36:57 -07:00
Miss Islington (bot)
072ec69af5
bpo-43837: Reverse order of precedence table to show tightly binding operators first (GH-25469) (GH-25472) 2021-04-19 08:56:38 -07:00
Miss Islington (bot)
dbc0e19a48
Fix description of behaviour of an exception class in 'from' clause (GH-24303) (GH-25341)
(cherry picked from commit 79650d0118b0a8861428b9dd063089de405cf137)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-04-11 10:27:51 +01:00
Miss Islington (bot)
a9228d02d1
[3.9] bpo-39702: Remove dotted_name from decorator documentation (GH-25234) (GH-25290)
(cherry picked from commit 1e051a21b7106a93c30b74aad7e1f40d6c0c477b)


Co-authored-by: Saiyang Gou <gousaiyang@163.com>

Automerge-Triggered-By: GH:brandtbucher
2021-04-08 16:03:53 -07:00
Saiyang Gou
3b1cf20297
[3.9] bpo-36540: Improve doc of function definition regarding positional-only arguments (GH-25235) (GH-25259)
(cherry picked from commit 58d72cab89cf9652acc0bf0007aa20b2bcc98499)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2021-04-07 20:32:48 +01:00
Miss Islington (bot)
f91fc7a679
bpo-43755: Update docs to reflect that lambda is not allowed in comp_if since 3.9 (GH-25231) (GH-25233) 2021-04-07 19:17:56 +01:00
Miss Islington (bot)
7cc58890b3
bpo-27646: Say that 'yield from' expression can be any iterable (GH-24595)
Previously, the doc at least strongly implied that it had to be an iterator.
(cherry picked from commit 2f9ef514fb24b6a95bd3272885f197752810c107)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-02-20 18:55:49 -08:00
Andre Delfino
7c48859eeb
[3.9] [doc] Fix a few margins due to bad markup (GH-23619). (GH-23859)
(cherry picked from commit 96a09df64483b70c4215c7025a19b9d2f1636c55)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-21 18:53:50 -08:00
Miss Islington (bot)
409ce4a09e
bpo-42669: Document that except rejects nested tuples (GH-23822) (GH-23870)
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
(cherry picked from commit c95f8bc2700b42f4568886505a819816c9b0ba28)

Co-authored-by: Colin Watson <cjwatson@debian.org>

Co-authored-by: Colin Watson <cjwatson@debian.org>
2020-12-20 16:18:08 -05:00
Miss Islington (bot)
be9e4402db
[3.9] bpo-41879: Doc: Fix description of async for statement (GH-23548) (GH-23749)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables.  This fix is relevant for version 3.7 onward.
(cherry picked from commit 4b8cdfcb22fbeaab9d954cb693a7fb3362a382b6)


Co-authored-by: Nick Gaya <nicholasgaya+github@gmail.com>
2020-12-12 20:24:31 -08:00
Miss Skeleton (bot)
a39068bf48
bpo-42198: Link to GenericAlias in typing and expressions (GH-23030)
Follow up to 7cdf30fff39ea97f403b5472096349998d190e30 and 4173320920706b49a004bdddd8d7108e8984e3fc. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
(cherry picked from commit 9129af6050b747f288baa9d4e7d43031647ed222)

Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
2020-10-29 21:23:33 -07:00
Miss Skeleton (bot)
2cb259fcf3
bpo-6761: Enhance __call__ documentation (GH-7987)
(cherry picked from commit 95f710c55714153f0c8cce48f8215bb3d866ac1d)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-10-27 09:42:36 -07:00
Miss Skeleton (bot)
2cccc29eaf
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
(cherry picked from commit 2d55aa9e37c9c84f4f6a8135d0326da0bcd8f38b)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-10-24 19:53:41 -07:00
Miss Skeleton (bot)
c3538b8381
bpo-41910: specify the default implementations of object.__eq__ and object.__ne__ (GH-22874) (#22876)
See Objects/typeobject.c:object_richcompare() for the implementation of this in CPython.

Co-authored-by: Brett Cannon <brett@python.org>
2020-10-21 20:07:39 -04:00
Miss Skeleton (bot)
6e842bcdf8
bpo-35181: Correct importlib documentation for some module attributes (GH-15190)
@ericsnowcurrently This PR will change the following:

In the library documentation importlib.rst:

- `module.__package__` can be `module.__name__` for packages;
- `spec.parent` can be `spec.__name__` for packages;
- `spec.loader` is not `None` for namespaces packages.

In the language documentation import.rst:

- `spec.loader` is not `None` for namespace packages.

Automerge-Triggered-By: GH:warsaw
(cherry picked from commit 27f1bd8787d24ac53cc3dc6ea5eb00b8a3499839)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2020-10-21 14:39:41 -07:00
Miss Skeleton (bot)
224ed378b9
Fix bpo-39416: Change "Numeric" to lower case; an english word, not a class name (GH-22867)
This is a trivial fix to [bpo-39416](), which didn't come up until it was already committed

```
Change "Numeric" to "numeric".

I believe this is trivial enough to not need an issue or a NEWS entry, although
I'm unclear on what branches the original pull request received backports.
```

Automerge-Triggered-By: GH:merwok
(cherry picked from commit f8b1ccd63c94bcde1c15d56d24add89861b6ceee)

Co-authored-by: kpinc <kop@karlpinc.com>
2020-10-21 13:54:39 -07:00
Miss Skeleton (bot)
ec62b47ebc
[3.9] bpo-39416: Document some restrictions on the default string representations of numeric classes (GH-18111) (GH-22860)
[[bpo-39416]()](): Document string representations of the Numeric classes

This is a change to the specification of the Python language.

The idea here is to put sane minimal limits on the Python language's default
representations of its Numeric classes.  That way "Marty's Robotic Massage Parlor
and Python Interpreter" implementation of Python won't do anything too
crazy.

Some discussion in the email thread:
Subject: Documenting Python's float.__str__()
https://mail.python.org/archives/list/python-dev@python.org/thread/FV22TKT3S2Q3P7PNN6MCXI6IX3HRRNAL/
(cherry picked from commit c60394c7fc9cc09b16e9675a3eeb5844b6d8523f)


Co-authored-by: kpinc <kop@karlpinc.com>

Automerge-Triggered-By: GH:merwok
2020-10-21 11:56:16 -07:00
Miss Skeleton (bot)
fcd776c6c2
Doc: Fix a typo/error in the docs for cached bytecode (GH-22445)
(cherry picked from commit cb115e36e1aba04b90b0ecac6f043e60064ac65b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-10-21 01:57:37 -07:00
Miss Skeleton (bot)
9e935adf74
Doc: Remove old Python version from future stmt (GH-21802)
(cherry picked from commit eba109a28f48b20b05f08abbe6604eebb07788f9)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-10-20 23:06:29 -07:00
Miss Skeleton (bot)
d05514ace6
[3.9] bpo-42010: [docs] Clarify subscription of types (GH-22822) (GH-22840)
(cherry picked from commit 7cdf30fff39ea97f403b5472096349998d190e30)


Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>

Automerge-Triggered-By: GH:gvanrossum
2020-10-20 16:58:49 -07:00