Commit Graph

451 Commits

Author SHA1 Message Date
Miss Islington (bot) 8693ec214c
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:24:43 -07:00
Miss Islington (bot) c92c5513b3
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:50 -08:00
Miss Islington (bot) 4217fafeac
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:44 -08:00
Miss Islington (bot) 0dea92409e
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:15:46 -08:00
Miss Islington (bot) 8eb4e2ce3f
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:23:01 -08:00
Miss Islington (bot) 5054ae23ce
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:44 -07:00
Miss Islington (bot) 0688f110a6
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:29 -07:00
Gregory P. Smith 8f0fa4bd10
[3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501)
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:51:49 -07:00
Miss Islington (bot) b69ba3d723
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:13:04 -07:00
Miss Islington (bot) 5f4588feec
gh-96197: Fix expression when :func:`sys.breakpointhook is missing (gh-96293)
(cherry picked from commit 47d406ffc4)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-08-25 19:03:16 -07:00
Miss Islington (bot) 83ff85bc59
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:38 -07:00
Miss Islington (bot) 223fde359a
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:51:23 -07:00
Miss Islington (bot) 158579654d
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:39:09 -07:00
Miss Islington (bot) a48d31f204
gh-81488: Add recursive wording for issubclass docs (GH-92087)
(cherry picked from commit 1066ecb970)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-30 21:21:51 -07:00
Miss Islington (bot) 88bbc5dd7a
bpo-30718: Add information about text buffering (GH-32351)
(cherry picked from commit 5101d97d0b)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-20 02:00:43 -07:00
Miss Islington (bot) a57ec7a4fe
bpo-43698: do not use `...` as argument name in docs (GH-30502)
(cherry picked from commit b9d8980d89)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-26 04:42:26 -08:00
Miss Islington (bot) c8044777cf
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
(cherry picked from commit f025ae63dc)

Co-authored-by: Vivek Vashist <vivekvashist@gmail.com>
2021-12-15 04:59:01 -08:00
Miss Islington (bot) 1f7000808e
bpo-19737: Improved the documentation for globals (GH-29823) (GH-30041)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 4fe5585240)

Co-authored-by: 180909 <734461790@qq.com>
2021-12-11 01:32:13 +01:00
Brett Cannon 99aad31b7a
[3.10] bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently required by CPython (GH-29170) (GH-29650)
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__`.
(cherry picked from commit be36e06340)

Co-authored-by: Brett Cannon <brett@python.org>
2021-11-22 15:09:15 -08:00
Miss Islington (bot) 8af3090cb7
[doc] Link to section File input (GH-28941) (GH-29375)
(cherry picked from commit 48824fa1e2)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2021-11-02 22:54:53 +01:00
Miss Islington (bot) 9b3cda5687
bpo-44344: Document that pow can return a complex number for non-complex inputs. (GH-27853) (GH-29135)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 887a55705b)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-10-22 00:08:20 +02:00
Łukasz Langa 8f9d398b46
[3.10] [docs] Improve the markup of powers (GH-28598) (GH-28607)
(cherry picked from commit 4f05f15d7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-28 23:09:58 +02:00
Łukasz Langa 0d41bf1570
[3.10] bpo-45246: Document that sorted() only uses "<" comparisons (GH-28494) (GH-28502)
(cherry picked from commit 9a0dcc5b2e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2021-09-21 22:32:09 +02:00
Miss Islington (bot) 8711b3d0ac
bpo-44135: [docs] Fix inline markup (GH-28095)
(cherry picked from commit 9a7ec2fcde)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-08-31 09:25:08 -07:00
Miss Islington (bot) ab8fed88fc
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)
Co-authored-by: Zachary Kneupper <zachary.kneupper@gmail.com>
(cherry picked from commit 08767c73b5)

Co-authored-by: Zack Kneupper <zachary.kneupper@gmail.com>
2021-08-31 07:23:22 -07:00
Miss Islington (bot) c79aa427c0
bpo-44522: Fix inaccurate information in open() function (GH-27650)
- Use "Low surrogate code units" instead of "Unicode Private Use Area"
(cherry picked from commit b05e9b63fc)

Co-authored-by: meowmeowmeowcat <meowmeowcat1211@gmail.com>
2021-08-09 07:35:11 -07:00
Miss Islington (bot) 2d0492091e
Clean up comma usage in Doc/library/functions.rst (GH-27083) (#27243)
(cherry picked from commit 1e651c6ada)

Co-authored-by: α∂мιηιχтяαтσя <sadiqherritage@gmail.com>
2021-07-19 18:38:56 +02:00
Miss Islington (bot) 05f8ad0c74
bpo-20408: Fix memoryview() signature in docs (GH-24431)
(cherry picked from commit d18e5dae91)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-05-25 17:30:00 +03:00
Andre Delfino 69a733bda3
[doc] Be more clear on super() regarding multiple base classes methods (GH-21789) 2021-04-28 18:12:15 -07:00
Géry Ogam d35eef3b90
Update Sphinx directive for super from function to class (GH-25489) 2021-04-20 11:58:02 -07:00
Victor Stinner 553ee2781a
bpo-43682: Make staticmethod objects callable (GH-25117)
Static methods (@staticmethod) are now callable as regular functions.
2021-04-12 00:21:22 +02:00
Victor Stinner 507a574de3
bpo-43682: @staticmethod inherits attributes (GH-25268)
Static methods (@staticmethod) and class methods (@classmethod) now
inherit the method attributes (__module__, __name__, __qualname__,
__doc__, __annotations__) and have a new __wrapped__ attribute.

Changes:

* Add a repr() method to staticmethod and classmethod types.
* Add tests on the @classmethod decorator.
2021-04-09 17:51:22 +02:00
Pablo Galindo d9692027f4
bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check (GH-25004) 2021-03-23 23:57:03 +00:00
Joshua Bronson f0a6fde882
bpo-31861: Add aiter and anext to builtins (#23847)
Co-authored-by: jab <jab@users.noreply.github.com>
Co-authored-by: Daniel Pope <mauve@mauveweb.co.uk>
Co-authored-by: Justin Wang <justin39@gmail.com>
2021-03-23 15:47:21 -07:00
Erik Soma 72fcd14a82
bpo-42840: Document providing kwargs to type. (#24173)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-03-01 15:21:04 -08:00
Ken Jin 5f77dee056
Improve docs of PEP 604 Union (#24301) 2021-02-08 17:57:11 -08:00
Terry Jan Reedy 0ec57e25c9
bpo-16781: In 'exec' doc, add 'nonlocal' to 'yield' and 'return' (GH-2446)
These 3 statements cannot be used at module scope -- nor in exec with one namespace.
2021-02-07 00:28:50 -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
Julien Palard 5c1f15b4b1
bpo-42843: Keep Sphinx 1.8 and Sphinx 2 compatibility (GH-24282) 2021-01-25 15:46:06 +01:00
Борис Верховский 644d52818a
bpo-40304: Correct type(name, bases, dict) doc (GH-19553)
Co-authored-by: Éric Araujo <merwok@netwok.org>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
2021-01-22 00:47:23 -05:00
Andre Delfino dcc997cd28
[doc] Fix erroneous backslashes in signatures and names (GH-23658)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).

The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did.
2020-12-16 17:37:28 -08:00
Antoine fc3dca3e16
Clarify eval() doc from library/functions. (GH-22700) 2020-12-16 16:45:19 +01:00
Rafael Fontenelle b76a840021
bpo-42180: fix plural in arguments and control (GH-23015)
https://bugs.python.org/issue42180
2020-10-29 20:48:21 +00:00
Antoine 0f25c231b3
Add a link to buffer protocol in bytearray() doc (GH-22675) 2020-10-26 14:26:34 +09:00
Saiyang Gou 3f7e990fd4
bpo-41192: Add documentation of undocumented audit events (GH-21308) 2020-10-20 15:23:15 -04:00
Batuhan Taskaya 155938907c
bpo-40484: Document compiler flags under AST module (GH-19885)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-10-19 02:14:11 +01:00
Batuhan Taskaya e799aa8b92
bpo-41887: omit leading spaces/tabs on ast.literal_eval (#22469)
Also document that eval() does this (the same way).
2020-10-03 17:46:44 -07:00
Andre Delfino c8bb24166e
[doc] Update references to NumPy (GH-22458)
Numeric(al) Python to NumPy. It seems the old name hasn't been used for some time.
2020-10-01 16:22:14 -07: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
Andre Delfino 802726acf6
Document vars behavior when __dict__ is missing (#21466) 2020-08-21 19:29:34 -03:00