Commit Graph

754 Commits

Author SHA1 Message Date
Andre Delfino 7c48859eeb
[3.9] [doc] Fix a few margins due to bad markup (GH-23619). (GH-23859)
(cherry picked from commit 96a09df644)

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 c95f8bc270)

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 4b8cdfcb22)


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 7cdf30fff3 and 4173320920. 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 9129af6050)

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 95f710c557)

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 2d55aa9e37)

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 27f1bd8787)

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 f8b1ccd63c)

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 c60394c7fc)


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 cb115e36e1)

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 eba109a28f)

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 7cdf30fff3)


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

Automerge-Triggered-By: GH:gvanrossum
2020-10-20 16:58:49 -07:00
Miss Skeleton (bot) 46130f8538
bpo-41192: Add documentation of undocumented audit events (GH-22831)
(cherry picked from commit 3f7e990fd4)
2020-10-20 16:05:13 -04:00
Miss Skeleton (bot) 4aad1e5770
bpo-41584: clarify when the reflected method of a binary arithemtic operator is called (GH-22505)
(cherry picked from commit d02d824e05)

Co-authored-by: Brett Cannon <brett@python.org>
2020-10-05 10:05:50 -07:00
Miss Islington (bot) c053402927
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".
(cherry picked from commit 8af239eacf)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-18 00:27:21 -07:00
Miss Islington (bot) b86e62644f
[doc] Remove superfluous comment about equal in f-strings (GH-22006)
Automerge-Triggered-By: @kushaldas
(cherry picked from commit 788b79fa7b)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-09-09 23:48:54 -07:00
Ammar Askar 46bc21e178
[3.9] bpo-41688: Document bug in **= dispatching in the language data… (GH-22172)
I tossed in a "This bug is fixed in Python 3.10" sentence but I'm not sure if that's appropriate to have here.
2020-09-09 11:01:38 -07:00
Victor Stinner 8f88190af5
[3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901)
* bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.

(cherry picked from commit 423e77d6de)

* bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)

Use generic '.. object::' to declare markers, rather than abusing
'..  c:function::' which fails on Sphinx 3.

(cherry picked from commit 43577c01a2)

* bpo-40204: Fix duplicates in the documentation (GH-21857)

Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.

(cherry picked from commit 46d10b1237)

* bpo-40204: Add :noindex: in the documentation (GH-21859)

Add :noindex: to duplicated documentation to fix "duplicate object
description" errors.

For example, fix this Sphinx 3 issue:

Doc/library/configparser.rst:1146: WARNING: duplicate object
description of configparser.ConfigParser.optionxform, other instance
in library/configparser, use :noindex: for one of them

(cherry picked from commit d3ded08048)

* bpo-40204, doc: Fix syntax of C variables (GH-21846)

For example, fix the following Sphinx 3 errors:

Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name. [error at 5]
  void \*obj
  -----^

Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*'
Invalid C declaration: Expected end of definition. [error at 8]
  PyObject*
  --------^

The modified documentation is compatible with Sphinx 2 and Sphinx 3.

(cherry picked from commit 474652fe93)

* bpo-40204: Fix reference to terms in the doc (GH-21865)

Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.

(cherry picked from commit bb0b08540c)

* bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)

Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:

Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions

(cherry picked from commit 1abeda80f7)
2020-08-19 19:25:22 +02:00
Guido van Rossum e962e3f65a
[3.9] bpo-41045: Document debug feature of f-strings ('=') (GH-21509) (GH-21645)
Co-Authored-By: Rishi <rishi93dev@gmail.com>

(cherry picked from commit 13efaec)

Co-authored-by: amaajemyfren <32741226+amaajemyfren@users.noreply.github.com>
2020-07-27 16:01:49 -07:00
Guido van Rossum e6b2d93f0c
[3.9] bpo-40939: Use the new grammar for the grammar specification documentation (GH-19969) (#21641)
(We censor the heck out of actions and some other stuff using a custom "highlighter".)

(cherry picked from commit 72cabb2aa6)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-07-27 12:00:42 -07:00
Miss Islington (bot) 616734b6c8
bpo-39868: Add documentation for Assignment Expressions (walrus, PEP 572) (GH-18851)
(cherry picked from commit f117cef25b)

Co-authored-by: Shankar Jha <shankarj67@gmail.com>
2020-07-25 16:40:48 -07:00
Miss Islington (bot) 2c0a59bb3d
Update lexical_analysis.rst (GH-17508)
Use Sphinx role markup for `str.format`.

Automerge-Triggered-By: @csabella
(cherry picked from commit e2fb8a2c42)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2020-06-12 06:01:20 -07:00
Miss Islington (bot) 962c814ca7
bpo-40439: Update broken link in lexical analysis docs (GH-20184)
Automerge-Triggered-By: @csabella
(cherry picked from commit af23f0d3cf)

Co-authored-by: Matteo Bertucci <matteobertucci2004@gmail.com>
2020-05-22 18:19:13 -07:00
Heshy Roskes ef33712baa
Fix typo in object.__format__ docs (GH-19504) 2020-04-25 21:57:09 -04:00
Mark Dickinson 810f68f128
Fix misinformation about NaN != NaN comparison (GH-19357) 2020-04-05 10:25:24 +01:00
Mathieu Dupuy c49016e67c
fix comma location in various places (GH-19233) 2020-03-30 14:28:25 -07:00
Javad Mokhtari 5f9c131c09
bpo-40045: Make "dunder" method documentation easier to locate (#19153)
* issue 40045

* Update lexical_analysis.rst

Make "dunder" method documentation easier(GH-19153)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-03-27 16:02:51 -03:00
Lahfa Samy 59c644eaa7
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Co-authored-by: furkanonder <furkantahaonder@gmail.com>
2020-03-26 09:54:04 -05:00
Benjamin Peterson 51796e5d26
Update some www.unicode.org URLs to use HTTPS. (GH-18912) 2020-03-10 21:10:59 -07:00
Benjamin Peterson 051b9d08d1
closes bpo-39926: Update Unicode to 13.0.0. (GH-18910) 2020-03-10 20:41:34 -07:00
Brandt Bucher 8f13053692
bpo-39702: Update the Language Reference (PEP 614) (GH-18802) 2020-03-07 10:23:49 -08:00
Caleb Donovick e59334ebc9
bpo-17422: slightly more precise language (GH-18682) 2020-03-06 10:20:48 -08:00
Brandt Bucher 8bae21962b
bpo-39868: Update Language Reference for PEP 572. (#18793) 2020-03-05 21:19:22 -08:00
MojoVampire 469325c30e
bpo-35712: Make using NotImplemented in a boolean context issue a deprecation warning (GH-13195) 2020-03-03 20:50:17 +02:00
ananthan-123 fbe2e0bb8a
bpo-17422: Language reference should specify restrictions on class namespace (#18559)
The language reference now specifies restrictions on class namespaces.  Adapted from a patch by Ethan Furman.
2020-02-22 09:56:01 -08:00
Serhiy Storchaka f632736023
bpo-39545: Document changes in the support of await in f-strings. (GH-18456)
https://bugs.python.org/issue39545
2020-02-13 15:57:35 -08:00
Bonifacio de Oliveira d47d0c8e9f
Improve grammar in the import system reference documentation (GH-18209)
Replaced the period with a comma.

Automerge-Triggered-By: @Mariatta
2020-01-29 18:23:50 -08:00
alclarks 7de617455e bpo-15243: Document __prepare__ as classmethod (GH-17124) 2020-01-25 21:49:58 +03:00
Géry Ogam 1d1b97ae64 bpo-39048: Look up __aenter__ before __aexit__ in async with (GH-17609)
* Reorder the __aenter__ and __aexit__ checks for async with
* Add assertions for async with body being skipped
* Swap __aexit__ and __aenter__ loading in the documentation
2020-01-14 21:58:29 +10:00
HongWeipeng abc0c4fa99 Fix the parameter list of object. _rpow_ (#GH-16477) 2020-01-05 17:20:29 -05:00
Géry Ogam 226e6e7d43 bpo-39037: Fix lookup order of magic methods in with statement documentation (GH-17608)
* __enter__ is now looked up before __exit__ to give a more intuitive error message
* add pseudo-code equivalent for the with statement
* fix pseudo-code for the async with statement to use a finally clause
* use SUITE rather than BLOCK for consistency with the language grammar

Patch by Géry Ogam.
2019-12-30 15:24:51 +10:00
Oleg Höfling cbd0408b54 links in importlib.metadata.rst replaced with sphinx references (GH-17730)
The importlib.metadata documentation uses hardcoded links to internal
pages. This results in minor rendering issues. This change replaces
the hardcoded links with suitable Sphinx roles.

Signed-off-by: Oleg Höfling <oleg.hoefling@gmail.com>
2019-12-29 12:26:35 -05:00
Batuhan Taşkaya d587272fe3 bpo-38316: Fix co_stacksize documentation (GH-16983) 2019-12-15 23:02:47 +01:00
Tal Einat 02519f75d1
bpo-38524: clarify example a bit and improve formatting (GH-17406) 2019-11-28 07:22:09 +02:00
Florian Dahlitz 1bddf890e5 bpo-38524: document implicit and explicit calling of descriptors' __set_name__ (GH-17364) 2019-11-27 10:46:40 +02:00
alclarks 4544e78ec4 bpo-25866: Minor cleanups to "sequence" in docs (GH-17177) 2019-11-17 14:00:43 -08:00
Shu 2d56af7a94 Fix minor typos. (GH-17095) 2019-11-12 19:12:11 -08:00
Shu fc6b1bf869 Clarify amount of dots between package and subpackage (GH-17092) 2019-11-08 12:26:35 -08:00
Géry Ogam 4c155f738d bpo-38336: Remove the __set__ method restriction on data descriptors for attribute lookup precedence (GH-16520) 2019-10-29 00:04:01 -07:00