Commit graph

13033 commits

Author SHA1 Message Date
Miss Islington (bot)
89523230d8
[3.12] gh-101575: document Decimal.__round__() (GH-101737) (GH-120395)
gh-101575: document Decimal.__round__() (GH-101737)
(cherry picked from commit 7dd8c37a06)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2024-06-13 09:10:17 +02:00
Miss Islington (bot)
319233f137
[3.12] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH-120347) (GH-120412)
* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae14)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-12 14:42:06 +00:00
Miss Islington (bot)
92e1c136b5
[3.12] Fix typo in ElementTree docs (GH-120342) (#120358)
Fix typo in ElementTree docs (GH-120342)
(cherry picked from commit 0335662fe1)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2024-06-11 17:19:06 +00:00
Miss Islington (bot)
b134f47574
[3.12] gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277) (GH-120278)
(cherry picked from commit 7c016deae6)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
2024-06-08 17:26:01 +00:00
Miss Islington (bot)
501cd99c8e
[3.12] gh-110383: Clarify "non-integral" wording in pow() docs (GH-119688) (#120207)
(cherry picked from commit 6646a9da26)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
2024-06-07 09:53:55 +00:00
Barney Gale
59224b8fdc
[3.12] GH-119054: Add "Reading directories" section to pathlib docs (GH-119956) (#120184)
Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

(cherry picked from commit 14e1506a6d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-07 01:24:44 +01:00
Alex Waygood
c5d1fbd4ce
[3.12] typing docs: fix indentation of TypedDict deprecation notice (#120124) 2024-06-05 10:37:24 -07:00
Miss Islington (bot)
376c734216
[3.12] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (#120106)
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657)
(cherry picked from commit 5c02ea8bae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-05 12:02:52 +00:00
Miss Islington (bot)
c46621bf33
[3.12] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120084)
(cherry picked from commit b6b0dcbfc0)

Co-authored-by: shurj0 <60540027+shurj0@users.noreply.github.com>
2024-06-05 00:29:28 +00:00
Barney Gale
059be67b51
[3.12] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524) (#119955)
Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed645)
2024-06-02 21:14:29 +01:00
Barney Gale
85020647c2
[3.12] GH-119054: Add "Querying file type and status" section to pathlib docs (GH-119055) (#119952)
Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336230)
2024-06-02 20:38:00 +01:00
Miss Islington (bot)
c8de0ec7b9
[3.12] Improve documentation for typing.get_type_hints (GH-119928) (#119944)
- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98e06)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-02 15:21:47 +00:00
Miss Islington (bot)
60393f5f14
[3.12] Add unique() recipe to itertools docs (gh-119911) (gh-119917) 2024-06-01 12:06:18 -05:00
Miss Islington (bot)
2f7fada580
[3.12] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119873)
Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f)
2024-05-31 17:27:57 +00:00
Serhiy Storchaka
207d1b032f
[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687) (ПР-119805)
* Remove the equivalence with real+imag*1j which can be incorrect in corner
  cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
  converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
  as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
  complex numbers. (This will be deprecated in future.)
(cherry picked from commit ec1ba26460)
2024-05-30 20:52:44 +00:00
Miss Islington (bot)
e408059711
[3.12] subprocess docs: Fix semantically important typo (GH-119752) (#119758)
subprocess docs: Fix semantically important typo (GH-119752)

GH-25416 accidentally replaced a reference to the *stderr* argument of
`subprocess.run` with a reference to the *stdin* argument.  *stdin* is
not affected by the `check_output` option.
(cherry picked from commit 2cc3502f98)

Co-authored-by: Zachary Ware <zach@python.org>
2024-05-30 08:50:23 +01:00
Miss Islington (bot)
681d7da144
[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119761)
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-05-30 03:24:50 +00:00
Miss Islington (bot)
3af9b75df5
[3.12] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119482)
Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab10)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-28 16:55:43 +02:00
Miss Islington (bot)
5cca0419cf
[3.12] [doc] Clarify the nature of the root logger in the logging documentation (GH-119440) (GH-119652)
(cherry picked from commit b407ad38fb)
2024-05-28 15:04:19 +01:00
Raymond Hettinger
8fb48542d3
[3.12] Misc cleanups and wording improvements for the itertools docs (gh-119631) 2024-05-27 13:43:08 -05:00
Miss Islington (bot)
823c66a789
[3.12] gh-119580: Improve version added section for convenience variable (GH-119583) (#119625)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-05-27 19:04:01 +01:00
Hugo van Kemenade
7f86c769db
[3.12] docs: fix a few typos identified by codespell (GH-119516) (#119571)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-26 08:15:57 +00:00
Raymond Hettinger
2d700670ad
[3.12] Misc improvements to the docs for itertools (gh-119532) 2024-05-24 17:35:38 -05:00
Miss Islington (bot)
ddaed629f4
[3.12] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119351)
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-23 00:16:23 -06:00
Miss Islington (bot)
7eb59cd95b
[3.12] gh-70795: Rework RLock documentation (GH-103853) (#119437)
gh-70795: Rework RLock documentation (GH-103853)

Attempted to simultaneously reduce verbosity, while more descriptively
describing behavior.

Fix links (RLock acquire/release previously linking to Lock
acquire/release, seems like bad copy pasta).

Add a seealso for with-locks.

Switch section to use bullet points.

---------

(cherry picked from commit 2fbea81d64)

Co-authored-by: uıɐɾ ʞ ʇɐɯɐs <_@skj.io>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-05-22 20:21:42 +00:00
Miss Islington (bot)
9bd9879ca7
[3.12] Clarify that dklen is expected in bytes for the hashlib functions (GH-106624) (GH-119384)
(cherry picked from commit 5adf78f546)

Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
2024-05-22 08:58:03 +00:00
Miss Islington (bot)
9801fbad67
[3.12] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (GH-119330) (#119371)
(cherry picked from commit 0e3c8cda1f)

Co-authored-by: Landon Wood <landon@elkrange.com>
2024-05-22 01:22:05 +00:00
Miss Islington (bot)
a1c20529e2
[3.12] gh-110383: Document socket.makefile() accepts combined modes (GH-119150) (#119325)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb)

Co-authored-by: Daniel Williams <dann0a@gmail.com>
2024-05-21 18:52:56 +00:00
Miss Islington (bot)
d8981abb1c
[3.12] gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232) (#119283)
gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232)

* Remove description of issue fixed in 3.5 from autospeccing guide

* Make autospeccing note text more succint and lint whitespace

* Add linting changes (missed in last commit)

---------

(cherry picked from commit 7e57640c7e)

Co-authored-by: Shauna <shaunagm@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-05-20 23:40:17 +00:00
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