Skip to content

Commit 972f74c

Browse files
committed
Catch up with main
2 parents 790faa9 + 8421b64 commit 972f74c

File tree

154 files changed

+1856
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1856
-431
lines changed

Doc/c-api/arg.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,26 @@ Other objects
357357

358358
.. versionadded:: 3.3
359359

360-
``(items)`` (:class:`tuple`) [*matching-items*]
361-
The object must be a Python sequence whose length is the number of format units
360+
``(items)`` (sequence) [*matching-items*]
361+
The object must be a Python sequence (except :class:`str`, :class:`bytes`
362+
or :class:`bytearray`) whose length is the number of format units
362363
in *items*. The C arguments must correspond to the individual format units in
363364
*items*. Format units for sequences may be nested.
364365

366+
If *items* contains format units which store a :ref:`borrowed buffer
367+
<c-arg-borrowed-buffer>` (``s``, ``s#``, ``z``, ``z#``, ``y``, or ``y#``)
368+
or a :term:`borrowed reference` (``S``, ``Y``, ``U``, ``O``, or ``O!``),
369+
the object must be a Python tuple.
370+
The *converter* for the ``O&`` format unit in *items* must not store
371+
a borrowed buffer or a borrowed reference.
372+
373+
.. versionchanged:: next
374+
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.
375+
376+
.. deprecated:: next
377+
Non-tuple sequences are deprecated if *items* contains format units
378+
which store a borrowed buffer or a borrowed reference.
379+
365380
A few other characters have a meaning in a format string. These may not occur
366381
inside nested parentheses. They are:
367382

Doc/c-api/buffer.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ characteristic of being backed by a possibly large memory buffer. It is
2626
then desirable, in some situations, to access that buffer directly and
2727
without intermediate copying.
2828

29-
Python provides such a facility at the C level in the form of the :ref:`buffer
30-
protocol <bufferobjects>`. This protocol has two sides:
29+
Python provides such a facility at the C and Python level in the form of the
30+
:ref:`buffer protocol <bufferobjects>`. This protocol has two sides:
3131

3232
.. index:: single: PyBufferProcs (C type)
3333

3434
- on the producer side, a type can export a "buffer interface" which allows
3535
objects of that type to expose information about their underlying buffer.
36-
This interface is described in the section :ref:`buffer-structs`;
36+
This interface is described in the section :ref:`buffer-structs`; for
37+
Python see :ref:`python-buffer-protocol`.
3738

3839
- on the consumer side, several means are available to obtain a pointer to
39-
the raw underlying data of an object (for example a method parameter).
40+
the raw underlying data of an object (for example a method parameter). For
41+
Python see :class:`memoryview`.
4042

4143
Simple objects such as :class:`bytes` and :class:`bytearray` expose their
4244
underlying buffer in byte-oriented form. Other forms are possible; for example,
@@ -62,6 +64,10 @@ In both cases, :c:func:`PyBuffer_Release` must be called when the buffer
6264
isn't needed anymore. Failure to do so could lead to various issues such as
6365
resource leaks.
6466

67+
.. versionadded:: 3.12
68+
69+
The buffer protocol is now accessible in Python, see
70+
:ref:`python-buffer-protocol` and :class:`memoryview`.
6571

6672
.. _buffer-structure:
6773

Doc/c-api/monitoring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,6 @@ would typically correspond to a python function.
205205
206206
.. versionadded:: 3.13
207207
208-
.. deprecated:: next
208+
.. deprecated:: 3.14
209209
210210
This function is :term:`soft deprecated`.

Doc/library/concurrent.futures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ the bytes over a shared :mod:`socket <socket>` or
298298

299299
The optional *initializer* and *initargs* arguments have the same
300300
meaning as for :class:`!ThreadPoolExecutor`: the initializer is run
301-
when each worker is created, though in this case it is run.in
301+
when each worker is created, though in this case it is run in
302302
the worker's interpreter. The executor serializes the *initializer*
303303
and *initargs* using :mod:`pickle` when sending them to the worker's
304304
interpreter.

Doc/library/ctypes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,7 @@ These are the fundamental ctypes data types:
26322632
Represents the C :c:expr:`PyObject *` datatype. Calling this without an
26332633
argument creates a ``NULL`` :c:expr:`PyObject *` pointer.
26342634

2635-
.. versionchanged:: next
2635+
.. versionchanged:: 3.14
26362636
:class:`!py_object` is now a :term:`generic type`.
26372637

26382638
The :mod:`!ctypes.wintypes` module provides quite some other Windows specific
@@ -2846,7 +2846,7 @@ fields, or any other data types containing pointer type fields.
28462846
:class:`!CField` objects are created via :attr:`~Structure._fields_`;
28472847
do not instantiate the class directly.
28482848

2849-
.. versionadded:: next
2849+
.. versionadded:: 3.14
28502850

28512851
Previously, descriptors only had ``offset`` and ``size`` attributes
28522852
and a readable string representation; the :class:`!CField` class was not

Doc/library/fnmatch.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`.
9090
but implemented more efficiently.
9191

9292

93+
.. function:: filterfalse(names, pat)
94+
95+
Construct a list from those elements of the :term:`iterable` of filename
96+
strings *names* that do not match the pattern string *pat*.
97+
It is the same as ``[n for n in names if not fnmatch(n, pat)]``,
98+
but implemented more efficiently.
99+
100+
.. versionadded:: 3.14
101+
102+
93103
.. function:: translate(pat)
94104

95105
Return the shell-style pattern *pat* converted to a regular expression for

Doc/library/graphlib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
A :exc:`ValueError` will be raised if the sort has been started by
110110
:meth:`~.static_order` or :meth:`~.get_ready`.
111111

112-
.. versionchanged:: next
112+
.. versionchanged:: 3.14
113113

114114
``prepare()`` can now be called more than once as long as the sort has
115115
not started. Previously this raised :exc:`ValueError`.

Doc/library/http.server.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ handler. Code to create and run the server looks like this::
7878

7979
By default, it is set to ``["http/1.1"]``, meaning the server supports HTTP/1.1.
8080

81-
.. versionadded:: next
81+
.. versionadded:: 3.14
8282

8383
.. class:: ThreadingHTTPSServer(server_address, RequestHandlerClass,\
8484
bind_and_activate=True, *, certfile, keyfile=None,\
@@ -88,7 +88,7 @@ handler. Code to create and run the server looks like this::
8888
requests by inheriting from :class:`~socketserver.ThreadingMixIn`. This is
8989
analogous to :class:`ThreadingHTTPServer` only using :class:`HTTPSServer`.
9090

91-
.. versionadded:: next
91+
.. versionadded:: 3.14
9292

9393

9494
The :class:`HTTPServer`, :class:`ThreadingHTTPServer`, :class:`HTTPSServer` and
@@ -588,15 +588,15 @@ The following options are accepted:
588588

589589
python -m http.server --tls-cert fullchain.pem
590590

591-
.. versionadded:: next
591+
.. versionadded:: 3.14
592592

593593
.. option:: --tls-key
594594

595595
Specifies a private key file for HTTPS connections.
596596

597597
This option requires ``--tls-cert`` to be specified.
598598

599-
.. versionadded:: next
599+
.. versionadded:: 3.14
600600

601601
.. option:: --tls-password-file
602602

@@ -609,7 +609,7 @@ The following options are accepted:
609609

610610
This option requires `--tls-cert`` to be specified.
611611

612-
.. versionadded:: next
612+
.. versionadded:: 3.14
613613

614614

615615
.. _http.server-security:

Doc/library/json.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,8 @@ Encoders and Decoders
486486
(to raise :exc:`TypeError`).
487487

488488
If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when
489-
trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`
490-
or ``None``. If *skipkeys* is true, such items are simply skipped.
489+
trying to encode keys that are not :class:`str`, :class:`int`, :class:`float`,
490+
:class:`bool` or ``None``. If *skipkeys* is true, such items are simply skipped.
491491

492492
If *ensure_ascii* is true (the default), the output is guaranteed to
493493
have all incoming non-ASCII characters escaped. If *ensure_ascii* is

Doc/library/multiprocessing.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,13 @@ object -- see :ref:`multiprocessing-managers`.
14211421
when invoked on an unlocked lock, a :exc:`ValueError` is raised.
14221422

14231423

1424+
.. method:: locked()
1425+
1426+
Return a boolean indicating whether this object is locked right now.
1427+
1428+
.. versionadded:: 3.14
1429+
1430+
14241431
.. class:: RLock()
14251432

14261433
A recursive lock object: a close analog of :class:`threading.RLock`. A
@@ -1481,6 +1488,13 @@ object -- see :ref:`multiprocessing-managers`.
14811488
differs from the implemented behavior in :meth:`threading.RLock.release`.
14821489

14831490

1491+
.. method:: locked()
1492+
1493+
Return a boolean indicating whether this object is locked right now.
1494+
1495+
.. versionadded:: 3.14
1496+
1497+
14841498
.. class:: Semaphore([value])
14851499

14861500
A semaphore object: a close analog of :class:`threading.Semaphore`.

0 commit comments

Comments
 (0)