Commit Graph

195 Commits

Author SHA1 Message Date
Miss Islington (bot) f1f0f2e3d7
[3.11] Clarify one-item tuple (GH-114745) (#114758)
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:32 +00:00
Miss Islington (bot) 350b4c7c0c
[3.11] gh-101100: Fix Sphinx warnings in `reference/expressions.rst` (GH-114194) (#114437)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-01-22 18:50:28 +02:00
Miss Islington (bot) 654c70a655
[3.11] gh-114070: fix token reference warnings in expressions.rst (GH-114169) (#114193)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-01-17 18:53:08 +02:00
Miss Islington (bot) 49005e4d02
[3.11] gh-112331: Fix reference manual description of attribute lookup mechanics (gh-112375) (gh-112413) 2023-11-25 22:26:22 +00:00
Miss Islington (bot) b64afbc55c
[3.11] gh-111944: Add assignment expression parentheses requirements (GH-111977) (#112011)
Augment the list of places where parentheses are
required around assignnment statements.  In particular,
'a := 0' and 'a = b := 1' are syntax errors.
(cherry picked from commit 9a2f25d374)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-11-13 00:14:03 +00: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
Miss Islington (bot) 3c1bcae075
[3.11] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) (GH-107418)
(cherry picked from commit f2d07d3289)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-29 09:17:20 +03:00
Miss Islington (bot) e0d951d68a
[3.11] Replace the esoteric term 'datum' when describing dict comprehensions (GH-106119) (#106349)
Replace the esoteric term 'datum' when describing dict comprehensions (GH-106119)
(cherry picked from commit 987b712b4a)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2023-07-03 03:25:12 +00:00
Federico Caselli acf3916e84
[3.11] Add single value `agen.athrow(value)` signature to the 3.11 docs gh-105269 (#105468) 2023-06-07 23:30:33 +01:00
Adam Turner 99e6314d93
[3.11] GH-97950: Use new-style index directive ('exception') (GH-104160) (#104161) 2023-05-04 13:48:57 +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) 693ef48df1
[3.11] GH-97950: Use new-style index directive ('operator') (GH-104156) (#104157)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 12:27:04 +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
Miss Islington (bot) b99ac1dbc0
fix `grammer` -> `grammar` typo in expressions.rst (GH-100683)
(cherry picked from commit 7feb6d2f85)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Automerge-Triggered-By: GH:AlexWaygood
2023-01-02 03:57:51 -08:00
Miss Islington (bot) 18ccb84697
gh-100201: Document behavior with a bare `yield` statement (GH-100416)
(cherry picked from commit 1aab269d4a)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-01-01 07:44:27 -08:00
Miss Islington (bot) 434943e0b4
[3.11] Python documents state elsewhere that a comma is not an operator (GH-98736) (#98757)
Python documents state elsewhere that a comma is not an operator, so calling it an operator here is confusing. See https://docs.python.org/3/reference/lexical_analysis.htmlGH-operators and https://docs.python.org/3/faq/programming.htmlGH-id22.
(cherry picked from commit d578aaea62)

Co-authored-by: Gerardwx <Gerardwx@users.noreply.github.com>
2022-10-28 12:15:34 +02:00
C.A.M. Gerlach ea19c28512
[3.11] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98371)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>.
(cherry picked from commit fa2d43e518)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-10-18 01:49:38 +02:00
Miss Islington (bot) 9828ccb63b
gh-97913 Docs: Add walrus operator to the index (GH-97921)
* Add walrus operator to the index

* Add named expression to the index

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>

* Fix indentation and add missing newline

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

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 296313002f)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-10-08 00:01:27 -07:00
Miss Islington (bot) 4aa2ebc01e
gh-86482: Document assignment expression need for ()s (GH-23291)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 2b5f1360ea)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-10-06 12:32:39 -07:00
Miss Islington (bot) 88ab19e47e
Fix docs on conditional expression grouping (GH-96447) (GH-97606) 2022-09-28 08:45:48 -05:00
Miss Islington (bot) 9eb1e6c692
gh-96397: Document that keywords in calls need not be identifiers (GH-96393)
This represents the official SC stance, see
https://github.com/python/steering-council/issues/142GH-issuecomment-1252172695
(cherry picked from commit 9d432b4a18)

Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
2022-09-22 11:18:02 -07:00
Łukasz Langa 49687b0054
[3.11] gh-93675: Fix typos in `Doc/` (GH-93676) (GH-94079)
Closes GH-93675
(cherry picked from commit 830513754d)

Co-authored-by: luzpaz <luzpaz@users.noreply.github.com>
2022-06-21 21:22:27 +02:00
Miss Islington (bot) 4d1e243fca
bpo-45393: help() on operator precedence has misleading entries (GH-31246) (GH-92965)
(cherry picked from commit fb082c2fc5)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-05-19 17:40:49 +02:00
Dave Goncalves 8be7c2bc5a
bpo-14911: Corrected generator.throw() documentation (GH-32207)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-31 16:56:48 +03:00
Alex Waygood 50731297a9
bpo-45680: Improve docs on subscriptions w.r.t. `GenericAlias` objects (GH-29479) 2022-03-07 19:49:28 -08:00
Jacob Walls 273cb8e757
bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) 2022-01-07 18:39:40 +00: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
Ethan Furman 6ecead106a
[doc] minor fixes to expressions.rst (GH-29444) 2021-11-06 10:26:43 -07:00
Tim Peters 51ed2c56a1
bpo-45530: speed listobject.c's unsafe_tuple_compare() (GH-29076)
Keep track of whether unsafe_tuple_compare() calls are resolved by the very
first tuple elements, and adjust strategy accordingly. This can significantly
cut the number of calls made to the full-blown PyObject_RichCompareBool(),
and especially when duplicates are rare.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-24 22:27:24 -05:00
Objectivitix 806e25fd31
bpo-45003: Change __div__ to __truediv__ in py3 language reference. (GH-27951) 2021-08-26 08:49:02 +03:00
andrei kulakov 4bd9caafb6
bpo-41911: Update docs for various expressions (GH-27470)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-07-30 18:52:44 +02:00
Serhiy Storchaka 054e9c84ac
bpo-33346: Allow async comprehensions inside implicit async comprehensions (GH-6766)
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-07-13 22:27:50 +01:00
Zackery Spytz 7d2b83e9f0
bpo-43990: Fix the footnote ordering in the operator precedence docs (GH-25805)
Footnotes 5 and 6 were in the wrong order.
2021-05-02 10:29:15 -07:00
Ammar Askar 68ba0c67ca
bpo-43837: Reverse order of precedence table to show tightly binding operators first (GH-25469) 2021-04-19 08:22:03 -07:00
Saiyang Gou 0fdf11e8e9
bpo-43755: Update docs to reflect that lambda is not allowed in `comp_if` since 3.9 (GH-25231) 2021-04-06 23:15:37 +01:00
Terry Jan Reedy 2f9ef514fb
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.
2021-02-20 21:33:25 -05:00
Ken Jin 2edaf6a4fb
bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513)
Clarify ``getattr`` and ``setattr`` requirements for accessing name-mangled attributes

Co-Authored-By: Catalin Iacob <iacobcatalin@gmail.com>
2021-02-02 13:06:57 -08:00
Joongi Kim 6e8dcdaaa4
bpo-41229: Update docs for explicit aclose()-required cases and add contextlib.aclosing() method (GH-21545)
This is a PR to:

 * Add `contextlib.aclosing` which ia analogous to `contextlib.closing` but for async-generators with an explicit test case for [bpo-41229]()
 * Update the docs to describe when we need explicit `aclose()` invocation.

which are motivated by the following issues, articles, and examples:

 * [bpo-41229]()
 * https://github.com/njsmith/async_generator
 * https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#cleanup-in-generators-and-async-generators
 * https://www.python.org/dev/peps/pep-0533/
 * https://github.com/achimnol/aiotools/blob/ef7bf0cea7af/src/aiotools/context.py#L152

Particuarly regarding [PEP-533](https://www.python.org/dev/peps/pep-0533/), its acceptance (`__aiterclose__()`) would make this little addition of `contextlib.aclosing()` unnecessary for most use cases, but until then this could serve as a good counterpart and analogy to `contextlib.closing()`. The same applies for `contextlib.closing` with `__iterclose__()`.
Also, still there are other use cases, e.g., when working with non-generator objects with `aclose()` methods.
2020-11-02 00:02:48 -08:00
kj 9129af6050
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.
2020-10-29 21:01:17 -07:00
kj 7cdf30fff3
bpo-42010: [docs] Clarify subscription of types (GH-22822) 2020-10-20 16:38:08 -07:00
Florian Dahlitz 2d55aa9e37
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>
2020-10-20 17:27:07 -04: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
Shankar Jha f117cef25b
bpo-39868: Add documentation for Assignment Expressions (walrus, PEP 572) (#18851) 2020-07-25 16:33:48 -07: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
Brandt Bucher 8bae21962b
bpo-39868: Update Language Reference for PEP 572. (#18793) 2020-03-05 21:19:22 -08:00
Emily Morehouse 6357c95716 bpo-35224: Additional documentation for Assignment Expressions (GH-15935)
Add or update assignment expression documentation for:
- FAQ - Design
- Reference - Expressions
- Reference - Lexical Analysis


https://bugs.python.org/issue35224



Automerge-Triggered-By: @matrixise
2019-09-11 07:37:12 -07:00
Andre Delfino dc26997109 bpo-33459: Fix "tuple displays" term in Expressions.rst (GH-6760)
https://bugs.python.org/issue33459



Automerge-Triggered-By: @matrixise
2019-09-11 06:16:11 -07:00
Raymond Hettinger edd21129dd
bpo-32118: Simplify docs for sequence comparison (GH-15450) 2019-08-24 10:43:55 -07:00