Skip to content

Commit 939cb99

Browse files
committed
Merge branch 'main' into fix-repl-cursor-pos-windows-module-completion
2 parents 3c3d0aa + e4f6445 commit 939cb99

26 files changed

+155
-84
lines changed

Doc/c-api/iter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ There are two functions specifically for working with iterators.
5454
5555
- ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
5656
- ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
57-
- ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.
57+
- ``PYGEN_ERROR`` if iterator has raised an exception. *presult* is set to ``NULL``.
5858
5959
.. versionadded:: 3.10

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Pending removal in Python 3.20
88
- :mod:`argparse`
99
- :mod:`csv`
1010
- :mod:`!ctypes.macholib`
11+
- :mod:`imaplib`
1112
- :mod:`ipaddress`
1213
- :mod:`json`
1314
- :mod:`logging` (``__date__`` also deprecated)

Doc/library/functools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ The :mod:`functools` module defines the following functions:
190190

191191
Note, type specificity applies only to the function's immediate arguments
192192
rather than their contents. The scalar arguments, ``Decimal(42)`` and
193-
``Fraction(42)`` are be treated as distinct calls with distinct results.
193+
``Fraction(42)`` are treated as distinct calls with distinct results.
194194
In contrast, the tuple arguments ``('answer', Decimal(42))`` and
195195
``('answer', Fraction(42))`` are treated as equivalent.
196196

Doc/library/glob.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,27 @@
1818
single: - (minus); in glob-style wildcards
1919
single: . (dot); in glob-style wildcards
2020

21-
The :mod:`glob` module finds all the pathnames matching a specified pattern
22-
according to the rules used by the Unix shell, although results are returned in
23-
arbitrary order. No tilde expansion is done, but ``*``, ``?``, and character
21+
The :mod:`!glob` module finds pathnames
22+
using pattern matching rules similar to the Unix shell.
23+
No tilde expansion is done, but ``*``, ``?``, and character
2424
ranges expressed with ``[]`` will be correctly matched. This is done by using
2525
the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions in concert, and
2626
not by actually invoking a subshell.
2727

28-
Note that files beginning with a dot (``.``) can only be matched by
28+
.. note::
29+
The pathnames are returned in no particular order. If you need a specific
30+
order, sort the results.
31+
32+
Files beginning with a dot (``.``) can only be matched by
2933
patterns that also start with a dot,
3034
unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
31-
(For tilde and shell variable expansion, use :func:`os.path.expanduser` and
32-
:func:`os.path.expandvars`.)
35+
For tilde and shell variable expansion, use :func:`os.path.expanduser` and
36+
:func:`os.path.expandvars`.
3337

3438
For a literal match, wrap the meta-characters in brackets.
3539
For example, ``'[?]'`` matches the character ``'?'``.
3640

37-
The :mod:`glob` module defines the following functions:
41+
The :mod:`!glob` module defines the following functions:
3842

3943

4044
.. function:: glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \
@@ -51,7 +55,7 @@ The :mod:`glob` module defines the following functions:
5155

5256
If *root_dir* is not ``None``, it should be a :term:`path-like object`
5357
specifying the root directory for searching. It has the same effect on
54-
:func:`glob` as changing the current directory before calling it. If
58+
:func:`!glob` as changing the current directory before calling it. If
5559
*pathname* is relative, the result will contain paths relative to
5660
*root_dir*.
5761

Doc/library/resource.rst

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ platform.
141141
.. data:: RLIMIT_CPU
142142

143143
The maximum amount of processor time (in seconds) that a process can use. If
144-
this limit is exceeded, a :const:`SIGXCPU` signal is sent to the process. (See
144+
this limit is exceeded, a :const:`~signal.SIGXCPU` signal is sent to the process. (See
145145
the :mod:`signal` module documentation for information about how to catch this
146146
signal and do something useful, e.g. flush open files to disk.)
147147

@@ -363,47 +363,47 @@ These functions are used to retrieve resource usage information:
363363
For backward compatibility, the return value is also accessible as a tuple of 16
364364
elements.
365365

366-
The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are
366+
The fields :attr:`!ru_utime` and :attr:`!ru_stime` of the return value are
367367
floating-point values representing the amount of time spent executing in user
368368
mode and the amount of time spent executing in system mode, respectively. The
369369
remaining values are integers. Consult the :manpage:`getrusage(2)` man page for
370370
detailed information about these values. A brief summary is presented here:
371371

372-
+--------+---------------------+---------------------------------------+
373-
| Index | Field | Resource |
374-
+========+=====================+=======================================+
375-
| ``0`` | :attr:`ru_utime` | time in user mode (float seconds) |
376-
+--------+---------------------+---------------------------------------+
377-
| ``1`` | :attr:`ru_stime` | time in system mode (float seconds) |
378-
+--------+---------------------+---------------------------------------+
379-
| ``2`` | :attr:`ru_maxrss` | maximum resident set size |
380-
+--------+---------------------+---------------------------------------+
381-
| ``3`` | :attr:`ru_ixrss` | shared memory size |
382-
+--------+---------------------+---------------------------------------+
383-
| ``4`` | :attr:`ru_idrss` | unshared memory size |
384-
+--------+---------------------+---------------------------------------+
385-
| ``5`` | :attr:`ru_isrss` | unshared stack size |
386-
+--------+---------------------+---------------------------------------+
387-
| ``6`` | :attr:`ru_minflt` | page faults not requiring I/O |
388-
+--------+---------------------+---------------------------------------+
389-
| ``7`` | :attr:`ru_majflt` | page faults requiring I/O |
390-
+--------+---------------------+---------------------------------------+
391-
| ``8`` | :attr:`ru_nswap` | number of swap outs |
392-
+--------+---------------------+---------------------------------------+
393-
| ``9`` | :attr:`ru_inblock` | block input operations |
394-
+--------+---------------------+---------------------------------------+
395-
| ``10`` | :attr:`ru_oublock` | block output operations |
396-
+--------+---------------------+---------------------------------------+
397-
| ``11`` | :attr:`ru_msgsnd` | messages sent |
398-
+--------+---------------------+---------------------------------------+
399-
| ``12`` | :attr:`ru_msgrcv` | messages received |
400-
+--------+---------------------+---------------------------------------+
401-
| ``13`` | :attr:`ru_nsignals` | signals received |
402-
+--------+---------------------+---------------------------------------+
403-
| ``14`` | :attr:`ru_nvcsw` | voluntary context switches |
404-
+--------+---------------------+---------------------------------------+
405-
| ``15`` | :attr:`ru_nivcsw` | involuntary context switches |
406-
+--------+---------------------+---------------------------------------+
372+
+--------+----------------------+---------------------------------------+
373+
| Index | Field | Resource |
374+
+========+======================+=======================================+
375+
| ``0`` | :attr:`!ru_utime` | time in user mode (float seconds) |
376+
+--------+----------------------+---------------------------------------+
377+
| ``1`` | :attr:`!ru_stime` | time in system mode (float seconds) |
378+
+--------+----------------------+---------------------------------------+
379+
| ``2`` | :attr:`!ru_maxrss` | maximum resident set size |
380+
+--------+----------------------+---------------------------------------+
381+
| ``3`` | :attr:`!ru_ixrss` | shared memory size |
382+
+--------+----------------------+---------------------------------------+
383+
| ``4`` | :attr:`!ru_idrss` | unshared memory size |
384+
+--------+----------------------+---------------------------------------+
385+
| ``5`` | :attr:`!ru_isrss` | unshared stack size |
386+
+--------+----------------------+---------------------------------------+
387+
| ``6`` | :attr:`!ru_minflt` | page faults not requiring I/O |
388+
+--------+----------------------+---------------------------------------+
389+
| ``7`` | :attr:`!ru_majflt` | page faults requiring I/O |
390+
+--------+----------------------+---------------------------------------+
391+
| ``8`` | :attr:`!ru_nswap` | number of swap outs |
392+
+--------+----------------------+---------------------------------------+
393+
| ``9`` | :attr:`!ru_inblock` | block input operations |
394+
+--------+----------------------+---------------------------------------+
395+
| ``10`` | :attr:`!ru_oublock` | block output operations |
396+
+--------+----------------------+---------------------------------------+
397+
| ``11`` | :attr:`!ru_msgsnd` | messages sent |
398+
+--------+----------------------+---------------------------------------+
399+
| ``12`` | :attr:`!ru_msgrcv` | messages received |
400+
+--------+----------------------+---------------------------------------+
401+
| ``13`` | :attr:`!ru_nsignals` | signals received |
402+
+--------+----------------------+---------------------------------------+
403+
| ``14`` | :attr:`!ru_nvcsw` | voluntary context switches |
404+
+--------+----------------------+---------------------------------------+
405+
| ``15`` | :attr:`!ru_nivcsw` | involuntary context switches |
406+
+--------+----------------------+---------------------------------------+
407407

408408
This function will raise a :exc:`ValueError` if an invalid *who* parameter is
409409
specified. It may also raise :exc:`error` exception in unusual circumstances.

Doc/library/signal.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ The variables defined in the :mod:`signal` module are:
265265

266266
.. availability:: Unix.
267267

268+
.. data:: SIGXCPU
269+
270+
CPU time limit exceeded.
271+
272+
.. availability:: Unix.
273+
268274
.. data:: SIG*
269275

270276
All the signal numbers are defined symbolically. For example, the hangup signal

Doc/library/zlib.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,20 @@ The available exception and functions in this module are:
5656

5757
.. versionadded:: 3.15
5858

59-
.. function:: compress(data, /, level=-1, wbits=MAX_WBITS)
59+
.. function:: compress(data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)
6060

6161
Compresses the bytes in *data*, returning a bytes object containing compressed data.
6262
*level* is an integer from ``0`` to ``9`` or ``-1`` controlling the level of compression;
63-
``1`` (Z_BEST_SPEED) is fastest and produces the least compression, ``9`` (Z_BEST_COMPRESSION)
64-
is slowest and produces the most. ``0`` (Z_NO_COMPRESSION) is no compression.
65-
The default value is ``-1`` (Z_DEFAULT_COMPRESSION). Z_DEFAULT_COMPRESSION represents a default
66-
compromise between speed and compression (currently equivalent to level 6).
63+
See :const:`Z_BEST_SPEED` (``1``), :const:`Z_BEST_COMPRESSION` (``9``),
64+
:const:`Z_NO_COMPRESSION` (``0``), and the default,
65+
:const:`Z_DEFAULT_COMPRESSION` (``-1``) for more information about these values.
6766

6867
.. _compress-wbits:
6968

7069
The *wbits* argument controls the size of the history buffer (or the
7170
"window size") used when compressing data, and whether a header and
7271
trailer is included in the output. It can take several ranges of values,
73-
defaulting to ``15`` (MAX_WBITS):
72+
defaulting to ``15`` (:const:`MAX_WBITS`):
7473

7574
* +9 to +15: The base-two logarithm of the window size, which
7675
therefore ranges between 512 and 32768. Larger values produce
@@ -94,17 +93,15 @@ The available exception and functions in this module are:
9493
The *wbits* parameter is now available to set window bits and
9594
compression type.
9695

97-
.. function:: compressobj(level=-1, method=DEFLATED, wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strategy=Z_DEFAULT_STRATEGY[, zdict])
96+
.. function:: compressobj(level=Z_DEFAULT_COMPRESSION, method=DEFLATED, wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strategy=Z_DEFAULT_STRATEGY[, zdict])
9897

9998
Returns a compression object, to be used for compressing data streams that won't
10099
fit into memory at once.
101100

102101
*level* is the compression level -- an integer from ``0`` to ``9`` or ``-1``.
103-
A value of ``1`` (Z_BEST_SPEED) is fastest and produces the least compression,
104-
while a value of ``9`` (Z_BEST_COMPRESSION) is slowest and produces the most.
105-
``0`` (Z_NO_COMPRESSION) is no compression. The default value is ``-1`` (Z_DEFAULT_COMPRESSION).
106-
Z_DEFAULT_COMPRESSION represents a default compromise between speed and compression
107-
(currently equivalent to level 6).
102+
See :const:`Z_BEST_SPEED` (``1``), :const:`Z_BEST_COMPRESSION` (``9``),
103+
:const:`Z_NO_COMPRESSION` (``0``), and the default,
104+
:const:`Z_DEFAULT_COMPRESSION` (``-1``) for more information about these values.
108105

109106
*method* is the compression algorithm. Currently, the only supported value is
110107
:const:`DEFLATED`.
@@ -119,7 +116,7 @@ The available exception and functions in this module are:
119116

120117
*strategy* is used to tune the compression algorithm. Possible values are
121118
:const:`Z_DEFAULT_STRATEGY`, :const:`Z_FILTERED`, :const:`Z_HUFFMAN_ONLY`,
122-
:const:`Z_RLE` (zlib 1.2.0.1) and :const:`Z_FIXED` (zlib 1.2.2.2).
119+
:const:`Z_RLE` and :const:`Z_FIXED`.
123120

124121
*zdict* is a predefined compression dictionary. This is a sequence of bytes
125122
(such as a :class:`bytes` object) containing subsequences that are expected
@@ -247,7 +244,7 @@ Compression objects support the following methods:
247244
All pending input is processed, and a bytes object containing the remaining compressed
248245
output is returned. *mode* can be selected from the constants
249246
:const:`Z_NO_FLUSH`, :const:`Z_PARTIAL_FLUSH`, :const:`Z_SYNC_FLUSH`,
250-
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK` (zlib 1.2.3.4), or :const:`Z_FINISH`,
247+
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK`, or :const:`Z_FINISH`,
251248
defaulting to :const:`Z_FINISH`. Except :const:`Z_FINISH`, all constants
252249
allow compressing further bytestrings of data, while :const:`Z_FINISH` finishes the
253250
compressed stream and prevents compressing any more data. After calling :meth:`flush`
@@ -365,24 +362,25 @@ behavior:
365362

366363
.. data:: Z_NO_COMPRESSION
367364

368-
Compression level ``0``.
365+
Compression level ``0``; no compression.
369366

370367
.. versionadded:: 3.6
371368

372369

373370
.. data:: Z_BEST_SPEED
374371

375-
Compression level ``1``.
372+
Compression level ``1``; fastest and produces the least compression.
376373

377374

378375
.. data:: Z_BEST_COMPRESSION
379376

380-
Compression level ``9``.
377+
Compression level ``9``; slowest and produces the most compression.
381378

382379

383380
.. data:: Z_DEFAULT_COMPRESSION
384381

385-
Default compression level (``-1``).
382+
Default compression level (``-1``); a compromise between speed and
383+
compression. Currently equivalent to compression level ``6``.
386384

387385

388386
.. data:: Z_DEFAULT_STRATEGY

Doc/reference/datamodel.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ Special attributes
11851185
single: __module__ (class attribute)
11861186
single: __dict__ (class attribute)
11871187
single: __bases__ (class attribute)
1188+
single: __base__ (class attribute)
11881189
single: __doc__ (class attribute)
11891190
single: __annotations__ (class attribute)
11901191
single: __annotate__ (class attribute)
@@ -1219,6 +1220,13 @@ Special attributes
12191220
In most cases, for a class defined as ``class X(A, B, C)``,
12201221
``X.__bases__`` will be exactly equal to ``(A, B, C)``.
12211222

1223+
* - .. attribute:: type.__base__
1224+
- .. impl-detail::
1225+
1226+
The single base class in the inheritance chain that is responsible
1227+
for the memory layout of instances. This attribute corresponds to
1228+
:c:member:`~PyTypeObject.tp_base` at the C level.
1229+
12221230
* - .. attribute:: type.__doc__
12231231
- The class's documentation string, or ``None`` if undefined.
12241232
Not inherited by subclasses.

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Doc/library/os.rst
2727
Doc/library/pickletools.rst
2828
Doc/library/profile.rst
2929
Doc/library/pyexpat.rst
30-
Doc/library/resource.rst
3130
Doc/library/select.rst
3231
Doc/library/socket.rst
3332
Doc/library/ssl.rst

Doc/whatsnew/3.15.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ mimetypes
682682
---------
683683

684684
* Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.)
685+
* Rename ``application/x-texinfo`` to ``application/texinfo``.
686+
(Contributed by Charlie Lin in :gh:`140165`)
685687

686688

687689
pathlib
@@ -825,6 +827,7 @@ New deprecations
825827
- :mod:`argparse`
826828
- :mod:`csv`
827829
- :mod:`!ctypes.macholib`
830+
- :mod:`imaplib`
828831
- :mod:`ipaddress`
829832
- :mod:`json`
830833
- :mod:`logging` (``__date__`` also deprecated)

0 commit comments

Comments
 (0)