Commit graph

12904 commits

Author SHA1 Message Date
Miss Islington (bot)
cdccafb2d4
[3.12] gh-108267 Fix another dataclasses docs typo (GH-119277) (#119280)
gh-108267 Fix another dataclasses docs typo (GH-119277)
(cherry picked from commit 423bbcbbc4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-20 18:48:54 -04:00
Miss Islington (bot)
17389446c6
[3.12] Use correct markup in unittest.mock.reset_mock documentation (GH-119207) (GH-119249)
Use correct markup in unittest.mock.reset_mock documentation (GH-119207)
(cherry picked from commit 6b80a5b20f)

Co-authored-by: Tialo <65392801+Tialo@users.noreply.github.com>
2024-05-20 22:12:29 +02:00
Miss Islington (bot)
a50f0651ee
[3.12] DOCS: Suggest always calling exec with a globals argument and no locals argument (GH-119235) (#119240)
DOCS: Suggest always calling exec with a globals argument and no locals argument (GH-119235)

Many users think they want a locals argument for various reasons but they do not
understand that it makes code be treated as a class definition. They do not want
their code treated as a class definition and get surprised. The reason not
to pass locals specifically is that the following code raises a `NameError`:

```py
exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
""", {}, {})
```

The reason not to leave out globals is as follows:

```py
def t():
    exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
    """)
```
(cherry picked from commit 7e1a130b8f)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2024-05-20 18:11:36 +00:00
Miss Islington (bot)
30c687cdf8
[3.12] marshal docs: Remove reference to "Sun" (GH-119161) (#119168)
Nobody has been using a Sun machine for a long time. When I saw
this sentence in a lightning talk just now, I thought it was talking
about sending Python code on a spacecraft.
(cherry picked from commit 697465ff88)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-19 02:22:10 +00:00
Miss Islington (bot)
a370eebdd9
[3.12] Minor improvements to the docs for itertools.tee() (gh-119135) (gh-119137) 2024-05-18 01:51:20 -05:00
Miss Islington (bot)
a3db4e8f96
[3.12] gh-108267: Fix object.__setattr__ regression in dataclasses docs (GH-119082) (#119098)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-05-16 13:46:20 +00:00
Miss Islington (bot)
bac277f1dd
[3.12] Misc improvements to the itertools docs (gh-119040) (#119044) 2024-05-14 15:27:03 +00:00
Miss Islington (bot)
71ec3533c6
[3.12] Itertools docs: fix parameter names and indentation in Python equivalents (gh-118977) (#119042) 2024-05-14 14:59:11 +00:00
Miss Islington (bot)
275ec3917e
[3.12] gh-119010: Adds docs about __type_params__ to functools.update_wrapper (GH-119012) (#119014)
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012)
(cherry picked from commit b04c497f18)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-13 20:16:54 +00:00
Miss Islington (bot)
ce3fdf70f4
[3.12] Improve the rmtree doc for dir_fd param addition in 3.11 (GH-118964) (#118992)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-13 11:10:55 +00:00
Barney Gale
a0786bcb74
[3.12] GH-118701: Note that recursive wildcards aren't supported in PurePath.match() (#118713) 2024-05-11 19:10:51 +01:00
Miss Islington (bot)
af8db2b681
[3.12] Correct the argument names for secrets.choice and secrets.randbelow in secrets.rst (GH-118098) (GH-118907)
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098)

Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst`.
(cherry picked from commit c444362c6e)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2024-05-10 14:45:22 +00:00
Steve Dower
eb29e2f590
gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) 2024-05-09 19:18:56 +01:00
Serhiy Storchaka
530c3bb271
[3.12] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118794)
(cherry picked from commit 05c2fe1acd)
2024-05-08 19:55:13 +00:00
Miss Islington (bot)
b83b3cb9da
[3.12] docs: module page titles should not start with a link to themselves (GH-117099) (#118791)
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-08 19:42:01 +00:00
Miss Islington (bot)
e652dae6eb
[3.12] Docs: fix typos in documentation (GH-118752) (#118786)
Docs: fix typos in documentation (GH-118752)
(cherry picked from commit 7b0c247f1c)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-08 19:13:42 +00:00
Miss Islington (bot)
656491783d
[3.12] gh-118671: Updated dead ActiveState links (GH-118730) (#118754)
Co-authored-by: trag1c <trag1cdev@yahoo.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-05-08 07:22:35 +00:00
Miss Islington (bot)
8e53f66797
[3.12] gh-118310: Fix documentation for enum.Enum.__new__ (GH-118311) (GH-118699)
gh-118310: Fix documentation for `enum.Enum.__new__` (GH-118311)

The provided example was incorrect:
- The example enum was missing the `int` mixin as implied by the context
- The value of `int('1a', 16)` was incorrectly given as 17
  (should be 26)
(cherry picked from commit 48e52fe2c9)

Co-authored-by: Momo Eissenhauer <mmEissen@users.noreply.github.com>
2024-05-07 14:02:55 +02:00
Miss Islington (bot)
f85021a6a2
[3.12] gh-78612: Mark up eval() using param list (GH-115212) (#116044)
Also mention that the 'expression' parameter can be a string.
(cherry picked from commit a71e32ce8e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-05-07 13:49:29 +02:00
Raymond Hettinger
7b25d945e0
[3.12] Expand recipe for kernel density estimation to include common tasks. (gh-118659) 2024-05-06 14:51:27 -05:00
Miss Islington (bot)
f6c2b04d02
[3.12] Fix typo in Doc/library/asyncio-task.rst (GH-118627) (#118657)
Fix typo in Doc/library/asyncio-task.rst (GH-118627)
(cherry picked from commit fc50f1bdba)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-06 17:03:22 +00:00
Miss Islington (bot)
11888a8694
[3.12] GH-115577 Clarify netloc term usage in urllib.parse docs (GH-117632) (GH-118656)
(cherry picked from commit 3ed3bc379a)

Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
2024-05-06 17:01:50 +00:00
Miss Islington (bot)
68316a04f3
[3.12] gh-118476: Fix corner cases in islice() rough equivalent. (Gh-118559) (#118587) 2024-05-05 06:49:19 +00:00
Miss Islington (bot)
7da5737bd8
[3.12] Minor improvements to the itertools recipes (GH-118563) (#118565) 2024-05-03 17:20:29 -05:00
Miss Islington (bot)
4a18a9b4b3
[3.12] docs: clarify csv.DictReader's treatment of the first data row (GH-118549) (#118555)
(cherry picked from commit 9d67b72a49)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-03 15:55:09 +00:00
Miss Islington (bot)
a7f495c7ba
[3.12] gh-117492: Clarify documentation of typing.Never (GH-117678) (#118547)
(cherry picked from commit 852263e108)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-05-03 13:09:05 +00:00
Miss Islington (bot)
f61de0de64
[3.12] gh-117903: Clarify that the staticmethod descriptor is callable (GH-117925) (GH-118509)
(cherry picked from commit b3372481b6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-02 14:02:26 +00:00
Jelle Zijlstra
9ec7ddd826
[3.12] docs: typo: tiny grammar change: "pointed by" -> "pointed to by" (GH-118411) (#118504)
(cherry picked from commit a6b610a94b)

Co-authored-by: Andrew Zipperer <47086307+zipperer@users.noreply.github.com>
Co-authored-by: Andrew-Zipperer <atzipperer@gmail.com>
2024-05-02 06:01:06 +00:00
Miss Islington (bot)
668163865c
[3.12] gh-85453: Consistent backquotes on None occurences across datetime.rst (GH-118282) (#118419)
(cherry picked from commit 0f797402bc)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-04-30 10:44:23 +02:00
Miss Islington (bot)
8e7486f41d
[3.12] gh-118359: Improve docs for Bdb.user_call (GH-118368) (#118410)
gh-118359: Improve docs for Bdb.user_call (GH-118368)

The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
(cherry picked from commit 8e4fb5d260)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-04-29 21:07:56 +00:00
Miss Islington (bot)
817190c303
[3.12] gh-101100: Fix Sphinx warnings in library/faulthandler.rst (GH-118353) (#118366)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-28 12:41:02 -06:00
Jelle Zijlstra
186fbe82f7
[3.12] Fix note in Enum.__new__ docs (GH-118284) (#118325)
(cherry picked from commit 5a4d3df2fa)

Co-authored-by: Philipp A <flying-sheep@web.de>
2024-04-26 16:25:31 -07:00
Miss Islington (bot)
c784b3e8fc
[3.12] gh-85453: Make numeric literals consistent across datetime.rst (GH-118245) (#118248)
Remove code formatting from remaining numeric literals.
(cherry picked from commit 59a4d52973)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-04-24 20:27:19 +00:00
Miss Islington (bot)
0049e2bd38
[3.12] gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables (GH-118068) (#118244)
Also remove formatting from numeric literals.

(cherry picked from commit 809aa9a682)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-24 20:02:53 +00:00
Petr Viktorin
f86b17ac51
[3.12] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177)
* GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)

The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).

This patch updates the ranges with what was missing or otherwise
incorrect.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.

[1] https://github.com/python/cpython/issues/61602

* GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf17af)
(cherry picked from commit 40d75c2b7f)

---------

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2024-04-24 14:29:30 +02:00
Miss Islington (bot)
4d34b7f201
[3.12] Fix typo in py_compile.rst (GH-118102) (GH-118191)
(cherry picked from commit 0d221e9a19)

Co-authored-by: Animesh Kumar <animesh0721@gmail.com>
2024-04-23 17:22:19 +00:00
Miss Islington (bot)
fbe29e639d
[3.12] gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242) (GH-117508)
* gh-59215: unittest: restore _top_level_dir at end of discovery (GH-15242)
(cherry picked from commit fc5f68e58e)


Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-04-23 12:41:32 +00:00
Miss Islington (bot)
c869f4ed5c
[3.12] gh-118030: Group definitions for ParamSpecArgs and ParamSpecKwargs in typing.rst (GH-118154) (#118155)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-04-22 15:04:11 +00:00
Miss Islington (bot)
b1e5f2746d
[3.12] gh-115986 Improve pprint documentation accuracy (GH-117403) (#118146)
(cherry picked from commit ceb6038b05)

Co-authored-by: Kerim Kabirov <the.privat33r+gh@pm.me>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-22 10:34:48 +00:00
Miss Islington (bot)
6d87cb494b
[3.12] Docs: replace Harry Potter reference with Monty Python (GH-118130) (#118135)
Docs: replace Harry Potter reference with Monty Python (GH-118130)
(cherry picked from commit 1446024124)

Co-authored-by: Clément Robert <cr52@protonmail.com>
2024-04-21 18:10:15 +00:00
Miss Islington (bot)
ecb8e2bdac
[3.12] gh-118100: Improve links in ast.rst (GH-118101) (#118110)
gh-118100: Improve links in `ast.rst` (GH-118101)
(cherry picked from commit 2aa11cca11)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-19 18:34:55 +00:00
Alex Waygood
5430f61437
[3.12] gh-114053: Fix bad interaction of PEP-695, PEP-563 and `get_type_hints` (#118009) (#118104)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 13:41:28 +00:00
Miss Islington (bot)
26c659ecbd
[3.12] gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (GH-25384) (GH-118046)
gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (GH-25384)

The implementation uses 'ptr' for the name of the first parameter of
ctypes.string_at() and ctypes.wstring_at(). Align docs and docstrings
with the naming used in the implementation.

(cherry picked from commit 81a926bd20)

Co-authored-by: Shreyan Avigyan <shreyan.avigyan@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-04-19 13:23:26 +02:00
Miss Islington (bot)
a0f82dd6cc
[3.12] gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333) (#118080)
gh-64588: Clarify the difference between mu and xbar in statistics docs (GH-117333)

Thanks Davin Potts for the clarification idea.
(cherry picked from commit fefd5d9711)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-04-19 05:42:35 +00:00
Miss Islington (bot)
859fdee0b6
[3.12] gh-114539: Clarify implicit launching of shells by subprocess (GH-117996) (#118002)
gh-114539: Clarify implicit launching of shells by subprocess (GH-117996)
(cherry picked from commit a4b44d39cd)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-04-17 19:44:38 +01:00
Miss Islington (bot)
e95a535ea2
[3.12] gh-117977: Amend version changed annotation for os.chmod, os.chown, and os.listdir (GH-117978) (#117992)
(cherry picked from commit fccedbda93)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-04-17 15:05:35 +00:00
Miss Islington (bot)
5f4c7cf3f4
[3.12] gh-117945: Fix os.path.ismount() documentation (GH-117947) (#117952)
gh-117945: Fix `os.path.ismount()` documentation (GH-117947)
(cherry picked from commit a23fa3368e)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-04-16 23:02:13 +00:00
Hugo van Kemenade
eb0bfb5910
[3.12] Docs: add link roles with Sphinx extlinks (GH-117850) (#117910)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-04-15 13:18:21 -06:00
Nice Zombies
2dcb267324
[3.12] gh-117114: Update os.path function availability and link to genericpath.py in os.path.rst (GH-117756) 2024-04-15 15:49:44 +01:00
Miss Islington (bot)
a00dd31ee7
[3.12] Doc: mark up classes, attributes, parameters, and methods in dataclasses.rst (GH-117820) (#117877)
(cherry picked from commit e01831760e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-14 17:00:00 +00:00