Skip to content

Commit 03bcfad

Browse files
authored
Merge branch 'main' into fix/uuid/mac-address-libuuid-132710
2 parents 19c6262 + 4709417 commit 03bcfad

File tree

89 files changed

+2091
-728
lines changed

Some content is hidden

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

89 files changed

+2091
-728
lines changed

Doc/c-api/gcsupport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse`
180180
must name its arguments exactly *visit* and *arg*:
181181
182182
183-
.. c:function:: void Py_VISIT(PyObject *o)
183+
.. c:macro:: Py_VISIT(o)
184184
185-
If *o* is not ``NULL``, call the *visit* callback, with arguments *o*
185+
If the :c:expr:`PyObject *` *o* is not ``NULL``, call the *visit* callback, with arguments *o*
186186
and *arg*. If *visit* returns a non-zero value, then return it.
187187
Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers
188188
look like::

Doc/faq/design.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,12 @@ strings representing the files in the current directory. Functions which
420420
operate on this output would generally not break if you added another file or
421421
two to the directory.
422422

423-
Tuples are immutable, meaning that once a tuple has been created, you can't
424-
replace any of its elements with a new value. Lists are mutable, meaning that
425-
you can always change a list's elements. Only immutable elements can be used as
426-
dictionary keys, and hence only tuples and not lists can be used as keys.
423+
Tuples are :term:`immutable`, meaning that once a tuple has been created, you can't
424+
replace any of its elements with a new value. Lists are :term:`mutable`, meaning that
425+
you can always change a list's elements. Only :term:`hashable` objects can
426+
be used as dictionary keys. Most immutable types are hashable, which is why
427+
tuples, but not lists, can be used as keys. Note, however, that a tuple is
428+
only hashable if all of its elements are hashable.
427429

428430

429431
How are lists implemented in CPython?

Doc/howto/free-threading-extensions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ You can use it to enable code that only runs under the free-threaded build::
2323
/* code that only runs in the free-threaded build */
2424
#endif
2525

26+
.. note::
27+
28+
On Windows, this macro is not defined automatically, but must be specified
29+
to the compiler when building. The :func:`sysconfig.get_config_var` function
30+
can be used to determine whether the current running interpreter had the
31+
macro defined.
32+
33+
2634
Module Initialization
2735
=====================
2836

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,8 @@ have the form::
372372
for expr2 in sequence2
373373
if condition2
374374
for expr3 in sequence3
375-
...
376375
if condition3
376+
...
377377
for exprN in sequenceN
378378
if conditionN )
379379

Doc/library/json.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ is a lightweight data interchange format inspired by
1818
`JavaScript <https://en.wikipedia.org/wiki/JavaScript>`_ object literal syntax
1919
(although it is not a strict subset of JavaScript [#rfc-errata]_ ).
2020

21+
.. note::
22+
The term "object" in the context of JSON processing in Python can be
23+
ambiguous. All values in Python are objects. In JSON, an object refers to
24+
any data wrapped in curly braces, similar to a Python dictionary.
25+
2126
.. warning::
2227
Be cautious when parsing JSON data from untrusted sources. A malicious
2328
JSON string may cause the decoder to consume considerable CPU and memory
2429
resources. Limiting the size of data to be parsed is recommended.
2530

26-
:mod:`json` exposes an API familiar to users of the standard library
31+
This module exposes an API familiar to users of the standard library
2732
:mod:`marshal` and :mod:`pickle` modules.
2833

2934
Encoding basic Python object hierarchies::
@@ -60,7 +65,7 @@ Pretty printing::
6065
"6": 7
6166
}
6267

63-
Specializing JSON object encoding::
68+
Customizing JSON object encoding::
6469

6570
>>> import json
6671
>>> def custom_json(obj):
@@ -83,7 +88,7 @@ Decoding JSON::
8388
>>> json.load(io)
8489
['streaming API']
8590

86-
Specializing JSON object decoding::
91+
Customizing JSON object decoding::
8792

8893
>>> import json
8994
>>> def as_complex(dct):
@@ -279,7 +284,7 @@ Basic Usage
279284

280285
:param object_hook:
281286
If set, a function that is called with the result of
282-
any object literal decoded (a :class:`dict`).
287+
any JSON object literal decoded (a :class:`dict`).
283288
The return value of this function will be used
284289
instead of the :class:`dict`.
285290
This feature can be used to implement custom decoders,
@@ -289,7 +294,7 @@ Basic Usage
289294

290295
:param object_pairs_hook:
291296
If set, a function that is called with the result of
292-
any object literal decoded with an ordered list of pairs.
297+
any JSON object literal decoded with an ordered list of pairs.
293298
The return value of this function will be used
294299
instead of the :class:`dict`.
295300
This feature can be used to implement custom decoders.

Doc/library/multiprocessing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ object -- see :ref:`multiprocessing-managers`.
13691369
A solitary difference from its close analog exists: its ``acquire`` method's
13701370
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
13711371

1372+
.. method:: locked()
1373+
1374+
Return a boolean indicating whether this object is locked right now.
1375+
1376+
.. versionadded:: 3.14
1377+
13721378
.. note::
13731379
On macOS, this is indistinguishable from :class:`Semaphore` because
13741380
``sem_getvalue()`` is not implemented on that platform.
@@ -1521,6 +1527,12 @@ object -- see :ref:`multiprocessing-managers`.
15211527
A solitary difference from its close analog exists: its ``acquire`` method's
15221528
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
15231529

1530+
.. method:: locked()
1531+
1532+
Return a boolean indicating whether this object is locked right now.
1533+
1534+
.. versionadded:: 3.14
1535+
15241536
.. note::
15251537

15261538
On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with

Doc/library/re.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ Functions
991991
That way, separator components are always found at the same relative
992992
indices within the result list.
993993

994-
Empty matches for the pattern split the string only when not adjacent
995-
to a previous empty match.
994+
Adjacent empty matches are not possible, but an empty match can occur
995+
immediately after a non-empty match.
996996

997997
.. code:: pycon
998998
@@ -1095,9 +1095,12 @@ Functions
10951095

10961096
The optional argument *count* is the maximum number of pattern occurrences to be
10971097
replaced; *count* must be a non-negative integer. If omitted or zero, all
1098-
occurrences will be replaced. Empty matches for the pattern are replaced only
1099-
when not adjacent to a previous empty match, so ``sub('x*', '-', 'abxd')`` returns
1100-
``'-a-b--d-'``.
1098+
occurrences will be replaced.
1099+
1100+
Adjacent empty matches are not possible, but an empty match can occur
1101+
immediately after a non-empty match.
1102+
As a result, ``sub('x*', '-', 'abxd')`` returns ``'-a-b--d-'``
1103+
instead of ``'-a-b-d-'``.
11011104

11021105
.. index:: single: \g; in regular expressions
11031106

@@ -1128,8 +1131,7 @@ Functions
11281131
.. versionchanged:: 3.7
11291132
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
11301133
now are errors.
1131-
Empty matches for the pattern are replaced when adjacent to a previous
1132-
non-empty match.
1134+
An empty match can occur immediately after a non-empty match.
11331135

11341136
.. versionchanged:: 3.12
11351137
Group *id* can only contain ASCII digits.

Doc/library/socketserver.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ There are four basic concrete server classes:
2424
:meth:`~BaseServer.server_activate`. The other parameters are passed to
2525
the :class:`BaseServer` base class.
2626

27+
.. versionchanged:: next
28+
The default queue size is now ``socket.SOMAXCONN`` for :class:`socketserver.TCPServer`.
2729

2830
.. class:: UDPServer(server_address, RequestHandlerClass, bind_and_activate=True)
2931

Doc/tutorial/controlflow.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ Here is an example of a multi-line docstring::
10561056
>>> print(my_function.__doc__)
10571057
Do nothing, but document it.
10581058

1059-
No, really, it doesn't do anything.
1059+
No, really, it doesn't do anything.
10601060

10611061

10621062
.. _tut-annotations:

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,12 @@ Kumar Aditya, Edgar Margffoy, and many others.
829829
Some of these contributors are employed by Meta, which has continued to provide
830830
significant engineering resources to support this project.
831831

832+
From 3.14, when compiling extension modules for the free-threaded build of
833+
CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` now needs to
834+
be specified by the build backend, as it will no longer be determined
835+
automatically by the C compiler. For a running interpreter, the setting that
836+
was used at compile time can be found using :func:`sysconfig.get_config_var`.
837+
832838

833839
.. _whatsnew314-pyrepl-highlighting:
834840

0 commit comments

Comments
 (0)