Commit Graph

857 Commits

Author SHA1 Message Date
C.A.M. Gerlach dcc82331c8
gh-95975: Move except/*/finally ref labels to more precise locations (#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>
2022-10-02 07:12:56 +02:00
Ofey Chan 83a3de4e06
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428) 2022-09-30 09:43:02 +01:00
Andrew Kay d582edf0be
Fix docs on conditional expression grouping (GH-96447) 2022-09-27 21:57:32 -05:00
Jeff Allen 9d432b4a18
gh-96397: Document that keywords in calls need not be identifiers (#96393)
This represents the official SC stance, see
https://github.com/python/steering-council/issues/142#issuecomment-1252172695
2022-09-22 11:10:15 -07:00
Benjamin Peterson fd1e477f53
closes gh-96734: Update to Unicode 15.0.0. (GH-96809) 2022-09-13 15:45:12 -07:00
Jonathan Oberländer 3d3a86ed40
GH-96359: Fix docs that claim int(0|1) doesn't match False (GH-96361) 2022-08-28 15:48:51 -07:00
Ezio Melotti c3d591fd06
gh-95994: Clarify escaped newlines. (#96066)
* gh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-08-26 21:05:01 +02:00
Barry Warsaw e1182bc377
gh-94619: Remove long deprecated methods module_repr() and load_module() (#94624)
* gh-94619: Remove long deprecated methods module_repr() and load_module()

Closes #94619

* Update Misc/NEWS.d/next/Library/2022-07-06-14-57-33.gh-issue-94619.PRqKVX.rst

Fix typo

Co-authored-by: Brett Cannon <brett@python.org>

Co-authored-by: Brett Cannon <brett@python.org>
2022-08-04 17:24:26 -07:00
Serhiy Storchaka f79547a429
gh-91838: Use HTTPS links in docs for resources which redirect to HTTPS (GH-95527)
If an HTTP link is redirected to a same looking HTTPS link, the latter can
be used directly without changes in readability and behavior.
It protects from a men-in-the-middle attack.

This change does not affect Python examples.
2022-08-04 10:13:49 +03:00
July Tikhonov 79d2f549ad
Fix async method reference links in `compound_stmts` docs (GH-94935) 2022-07-22 12:03:17 -05:00
Thomas Grainger 6da988a46c
gh-91181: drop support for bytes on sys.path (GH-31934)
Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it.

Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2022-07-16 18:07:53 -07:00
Ned Batchelder 3440d197a5
Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551)
Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
2022-07-05 11:16:10 +02:00
luzpaz 830513754d
gh-93675: Fix typos in `Doc/` (GH-93676)
Closes #93675
2022-06-21 21:10:45 +02:00
Zackery Spytz fb082c2fc5
bpo-45393: help() on operator precedence has misleading entries (GH-31246)
Fix the formatting for "await x" and "not x" in the operator
precedence table.
2022-05-19 17:05:04 +02:00
slateny 549567c6e7
gh-80143: Add clarification for escape characters (#92292) 2022-05-10 11:12:29 -05:00
Robert Yang ee2205b208
gh-87304: Improve comments in language reference for imports (#92164) 2022-05-03 16:08:05 -06:00
Serhiy Storchaka 3483299a24
gh-81548: Deprecate octal escape sequences with value larger than 0o377 (GH-91668) 2022-04-30 13:16:27 +03:00
slateny b87f7f2c21
bpo-21761: Clarify __file__/__cached__ in import reference (GH-31565)
Automerge-Triggered-By: GH:brettcannon
2022-04-26 12:12:02 -07:00
slateny d5a69571f5
gh-89885: Improve import example in language reference (#91523)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-17 14:20:13 -07:00
Jiashuo Li 4f5d56f8f3
Language reference: Remove duplicated text about iterable unpacking (GH-25212) 2022-04-02 19:41:16 -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
Terry Jan Reedy 01be5d6446
bpo-24563: Link encoding names to encoding declarations (GH-32274) 2022-04-02 20:13:37 -04: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
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
jmcb 3af68fc77c
bpo-46013: Fix confusing kerning on period in docs (GH-29989) 2022-03-20 09:58:13 +00:00
David Gilbertson 28f84c72b6
Removed confusing reference to sys (GH-31638) 2022-03-08 07:43:27 -08:00
David Gilbertson ab014978ae
Removed ambiguity in __init_subclass__ docs (GH-31540) 2022-03-07 20:13:01 -08: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
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
Zackery Spytz b4bd1e1422
bpo-44977: Deprecate delegation of int to __trunc__ (GH-31031)
Calling int(a) when type(a) implements __trunc__ but not __int__
or __index__ now raises a DeprecationWarning.
2022-02-03 11:43:25 +02:00
Kinshuk Dua 08c0ed2d9c
bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) 2022-01-27 10:24:48 +00: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
Jacob Walls 273cb8e757
bpo-24650: Use full term "generator function" in yield expressions docs (GH-24663) 2022-01-07 18:39:40 +00: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
Alex Waygood aeb9ef4c72
bpo-46076: Improve documentation for per-attribute docstrings with `__slots__` (GH-30109) 2021-12-19 14:20:07 -06:00
Pablo Galindo 3ea574f35b
Fix some false positives of documentation syntax problems 2021-12-08 22:22:55 +00:00
Raymond Hettinger 4ccccb1cfc
bpo-20751: Match variable name to the example. (GH-29980) 2021-12-07 21:38:21 -06:00
Alex Waygood c0521fe49f
bpo-45840: Improve cross-references in the data model documentation (GH-29633) 2021-12-05 22:49:36 +02:00
Raymond Hettinger 135ecc3492
bpo-20751: Replace method example with attribute example, matching the descriptor howto (GH-29909) 2021-12-03 20:37:08 -06:00
Irit Katriel 8a45ca542a
bpo-45711: Change exc_info related APIs to derive type and traceback from the exception instance (GH-29780) 2021-11-30 22:37:04 +00:00
Arthur Milchior cd876c8493
bpo-45619: documentation of execution model: clarify and update binding summary (#29232)
This does two changes that are quite related.

0. it add that variable binding can occur in pattern matching, an update of 3.10
which seems to have been omitted from the list of bindings
1. Given how long the sentence already was, with even subcases in the middle of
the sentence, the commit breaks the sentence into an actual list.
2021-11-25 21:19:06 -08:00
Jouke Witteveen ee49484c0f
[doc] Clarify MRO precedence in descriptor super binding section (GH-29539)
A similar sentence is present in the 'Invocation from super' section of
the descriptor HOWTO, where it is already correct.
2021-11-20 17:55:35 +01:00
Brett Cannon be36e06340
bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170)
It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
2021-11-19 16:40:34 -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
Alex Waygood 31b3a70edb
[doc] bpo-45680: Disambiguate ``__getitem__`` and ``__class_getitem__`` in the data model (GH-29389)
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.
2021-11-18 16:54:25 +01:00
Ethan Furman 6ecead106a
[doc] minor fixes to expressions.rst (GH-29444) 2021-11-06 10:26:43 -07:00
Arthur Milchior d9c1868c25
bpo-45583: Correct datamodel documentation of int() (GH-29182)
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.
2021-10-28 21:48:37 +02: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
Luca Chiodini 4ecd119b00
bpo-45463: Clarify that global statements allows multiple names (GH-28851)
The global statement allows specifying a list of identifiers
(https://docs.python.org/3/reference/simple_stmts.html#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.
2021-10-16 08:55:12 -04:00