Commit Graph

474 Commits

Author SHA1 Message Date
Miss Islington (bot) 1f115a8822
[3.11] gh-107755: Document the correct default value of slice step (GH-107756) (#108956)
gh-107755: Document the correct default value of slice step (GH-107756)

Document the correct default value of slice step.
(cherry picked from commit 9bf350b066)

Co-authored-by: wim glenn <hey@wimglenn.com>
2023-09-07 02:11:53 +02:00
Miss Islington (bot) b89feac759
[3.11] gh-107662: Switch 'any' and 'anext' in functions.rst (GH-107663) (#107665)
gh-107662: Switch 'any' and 'anext' in functions.rst (GH-107663)

Order was reversed in index at top, not in body.
(cherry picked from commit 9ebc6ecbc3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-08-05 18:25:21 +01:00
Serhiy Storchaka cc76113cf8
[3.11] gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894) (GH-106955)
(cherry picked from commit d036db728e)
2023-07-21 14:49:21 +03:00
Miss Islington (bot) 44c335e47d
[3.11] gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883) (#106547)
gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883)
(cherry picked from commit ec7180bd1b)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2023-07-08 14:23:00 +05:30
Miss Islington (bot) f5e29f4245
[3.11] gh-101100: Docs: Fix references to several numeric dunders (GH-106278) (#106282)
gh-101100: Docs: Fix references to several numeric dunders (GH-106278)
(cherry picked from commit a8ae73965b)

Co-authored-by: F3eQnxN3RriK <drsuaimqjgar@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-30 15:40:13 +01:00
Miss Islington (bot) e794d469e3
[3.11] Add a mention of PYTHONBREAKPOINT to breakpoint() docs (GH-104430) (#104447)
Add a mention of PYTHONBREAKPOINT to breakpoint() docs (GH-104430)
(cherry picked from commit 1be80ed107)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2023-05-13 07:16:28 +00: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
Adam Turner 00563694bb
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154) 2023-05-04 11:39:15 +03:00
Miss Islington (bot) e715da6db1
gh-87864: Use correct function definition syntax in the docs (GH-103312)
(cherry picked from commit 50b4b15984)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-11 07:19:33 -07:00
Miss Islington (bot) 9357fc9b89
gh-81762: Clarify and simplify description of print's flush param (GH-103264)
(cherry picked from commit c396b6ddf3)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-04-05 04:49:08 -07:00
Miss Islington (bot) 3b4f8fc83d
gh-102105 Fix wording in filterfalse/quantify/filter (GH-102189)
(cherry picked from commit 81bf10e4f2)

Co-authored-by: Stefan Pochmann <609905+pochmann@users.noreply.github.com>
2023-02-24 08:21:40 -08:00
Miss Islington (bot) 6d98282ed4
[3.11] Sync-up parameter name in equivalent code snippet of `enumerate` (GH-101029) (#101030)
Sync-up parameter name in equivalent code snippet of `enumerate` (GH-101029)
(cherry picked from commit ef633e5000)

Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
2023-01-15 12:16:06 +05:30
Miss Islington (bot) af136e9877
gh-100428: Make int documentation more accurate (GH-100436)
- Remove first link to lexical definition of integer literal, since it
  doesn't apply (differs in handling of leading zeros, base needs to be
  explicitly specified, unicode digits are allowed)
- Better describe handling of leading zeros, unicode digits, underscores
- Base 0 does not work exactly as like a code literal, since it allows
  Unicode digits. Link code literal to lexical definition of integer
  literal.
(cherry picked from commit edfbf56f4c)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-01-01 19:21:58 -08:00
Miss Islington (bot) 7ed7127876
gh-100546: Remove incorrect positional-only marker from eval (GH-100547)
All the arguments are positional-only.

The current status after GH-99476 seems to be to not use positional-only
markers in documentation, hence I've simply removed it.
(cherry picked from commit 71159a8e07)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-31 17:06:31 -08:00
Miss Islington (bot) ac31120de7
GH-100101: Clarify documentation of zip's strict option (GH-100103)
(cherry picked from commit cf1c098180)

Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
2022-12-28 13:32:19 -08:00
Miss Islington (bot) bf0f306bcd
gh-100428: Make float documentation more accurate (GH-100437)
Previously, the grammar did not accept `float("10")`.
Also implement mdickinson's suggestion of removing the indirection.
(cherry picked from commit 2e1a9ce989)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-12-24 12:18:40 -08:00
Miss Islington (bot) a15ab1ec65
Doc: Make functions.html readable again. (GH-99476)
(cherry picked from commit 858cb79486)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-11-19 02:58:32 -08:00
Miss Islington (bot) c4408d35f6
gh-94286 Fix documentation of print default param (GH-94297)
(cherry picked from commit 2db55e0c00)

Co-authored-by: Nouran Ali <nouranalimohammed@gmail.com>
2022-11-06 12:24:02 -08:00
Miss Islington (bot) 42d536c1c7
gh-91485: Doc: Using Python syntax to document builtin Python functions. (GH-96579)
(cherry picked from commit 3c4cbd177f)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-10-15 07:32:37 -07:00
Miss Islington (bot) 3dc8eb41bc
gh-64921: Clarify wording for open()'s newline arg (GH-96171)
(cherry picked from commit 4a74e6ab38)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-07 11:21:01 -07:00
Miss Islington (bot) 19ec4d40a2
[3.11] gh-96197: Fix expression when :func:`sys.breakpointhook is missing (gh-96293) (#96294)
(cherry picked from commit 47d406ffc4)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-10-05 15:03:18 -07:00
Miss Islington (bot) 27891e0d7b
gh-96397: Document that attributes need not be identifiers (GH-96454)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit 9a11ed8e50)

Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
2022-09-29 16:25:10 -07:00
Gregory P. Smith f8b71da9aa
[3.11] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96500)
Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds.

This PR comes fresh from a pile of work done in our private PSRT security response team repo.

This backports https://github.com/python/cpython/pull/96499 aka 511ca94520

Signed-off-by: Christian Heimes [Red Hat] <christian@python.org>
Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org>
Reviews via the private PSRT repo via many others (see the NEWS entry in the PR).

<!-- gh-issue-number: gh-95778 -->
* Issue: gh-95778
<!-- /gh-issue-number -->

I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
2022-09-02 09:48:57 -07:00
Miss Islington (bot) 315807dac9
gh-96197: Define the behavior of repr if sys.displayhook is lost (gh-96242)
(cherry picked from commit 0319cd6825)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-08-25 19:12:43 -07:00
Miss Islington (bot) bf2728b9f1
gh-96197: Define the behavior of breakpoint if sys.breakpointhook is lost (gh-96231)
(cherry picked from commit 09563a764e)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-08-24 07:20:22 -07:00
Miss Islington (bot) cc42716275
gh-86986: Drop compatibility support for Sphinx 2 (GH-93737)
* Revert "bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282)"

This reverts commit 5c1f15b4b1

* Revert "bpo-42579: Make workaround for various versions of Sphinx more robust (GH-23662)"

This reverts commit b63a620014.
(cherry picked from commit 0efe3a1636)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-06-21 10:50:47 -07:00
Miss Islington (bot) f2aeb3f6f7
gh-71223: Improve rendering of some references in the docs (GH-93041)
For example, instead of "eval()uated" (link from "eval()")
show "evaluated" (link from the whole word).
(cherry picked from commit 7f835923c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-05-21 00:49:36 -07:00
Miss Islington (bot) 574d7b8d7c
bpo-39229: fix formatting in library/functions.rst (GH-17857)
Missing reference of auditing event presents error when building translated documentation
(cherry picked from commit f298ba1f27)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-05-08 16:34:01 -07:00
larryhastings 5021064390
gh-92203: Add closure support to exec(). (#92204)
Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
2022-05-06 10:09:35 -07:00
Raymond Hettinger ebaf0945f9
GH-89519: Deprecate classmethod descriptor chaining (#92379) 2022-05-06 02:57:53 -05:00
slateny 1066ecb970
gh-81488: Add recursive wording for issubclass docs (#92087) 2022-04-30 22:05:20 -06:00
Yurii Karabas 0ef8d921f5
gh-91603: Speed up isinstance/issubclass on union types (GH-91631)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-04-28 23:24:19 +08:00
Inada Naoki 1317b70f89
gh-91156: Use `locale.getencoding()` instead of getpreferredencoding (GH-91732)
Co-authored-by: Victor Stinner <vstinner@python.org>
2022-04-22 10:39:24 +09:00
slateny 5101d97d0b
bpo-30718: Add information about text buffering (GH-32351) 2022-04-20 17:24:53 +09: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
Nikita Sobolev b9d8980d89
bpo-43698: do not use `...` as argument name in docs (GH-30502) 2022-01-26 19:06:10 +09:00
Vivek Vashist f025ae63dc
Add Positional only arguments forward slash (/) to sorted() function in Built-in Functions document (GH-30113)
sorted() function is missing forward slash (/) in Built-in Functions documentation page.

Automerge-Triggered-By: GH:asvetlov
2021-12-15 03:24:38 -08:00
180909 4fe5585240
bpo-19737: Improved the documentation for globals (GH-29823)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-12-11 01:04:21 +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
Andre Delfino 48824fa1e2
[doc] Link to section File input (GH-28941) 2021-11-02 22:34:00 +01:00
Mark Dickinson 887a55705b
bpo-44344: Document that pow can return a complex number for non-complex inputs. (GH-27853)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-10-21 22:57:49 +02:00
Serhiy Storchaka 4f05f15d7b
[docs] Improve the markup of powers (GH-28598) 2021-09-28 22:40:57 +02:00
Raymond Hettinger 9a0dcc5b2e
bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) 2021-09-21 12:26:27 -05:00
Victor Stinner 19ba2122ac
bpo-37330: open() no longer accept 'U' in file mode (GH-28118)
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
2021-09-02 12:58:00 +02:00
Ken Jin 9a7ec2fcde
bpo-44135: [docs] Fix inline markup (GH-28095) 2021-08-31 18:01:17 +02:00
Zack Kneupper 08767c73b5
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)
Co-authored-by: Zachary Kneupper <zachary.kneupper@gmail.com>
2021-08-31 15:39:19 +02:00
meowmeowmeowcat b05e9b63fc
bpo-44522: Fix inaccurate information in open() function (GH-27650)
- Use "Low surrogate code units" instead of "Unicode Private Use Area"
2021-08-09 16:14:54 +02:00
α∂мιηιχтяαтσя 1e651c6ada
Clean up comma usage in Doc/library/functions.rst (#27083) 2021-07-19 18:02:23 +02:00