Skip to content

Commit fcf76a7

Browse files
Merge branch 'main' into fix-suggestion
2 parents 75defab + 12a20da commit fcf76a7

146 files changed

Lines changed: 6100 additions & 2419 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ jobs:
283283
- { name: openssl, version: 3.4.5 }
284284
- { name: openssl, version: 3.5.6 }
285285
- { name: openssl, version: 3.6.2 }
286+
- { name: openssl, version: 4.0.0 }
286287
## AWS-LC
287288
- { name: aws-lc, version: 1.72.1 }
288289
env:

Doc/c-api/synchronization.rst

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ there is no :c:type:`PyObject` -- for example, when working with a C type that
8484
does not extend or wrap :c:type:`PyObject` but still needs to call into the C
8585
API in a manner that might lead to deadlocks.
8686
87-
The functions and structs used by the macros are exposed for cases
88-
where C macros are not available. They should only be used as in the
89-
given macro expansions. Note that the sizes and contents of the structures may
90-
change in future Python versions.
91-
9287
.. note::
9388
9489
Operations that need to lock two objects at once must use
@@ -114,12 +109,15 @@ section API avoids potential deadlocks due to reentrancy and lock ordering
114109
by allowing the runtime to temporarily suspend the critical section if the
115110
code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
116111
112+
.. _critical-section-macros:
113+
117114
.. c:macro:: Py_BEGIN_CRITICAL_SECTION(op)
118115
119116
Acquires the per-object lock for the object *op* and begins a
120117
critical section.
121118
122-
In the free-threaded build, this macro expands to::
119+
In the free-threaded build, and when building for the
120+
:ref:`Stable ABI <stable-abi>`, this macro expands to::
123121
124122
{
125123
PyCriticalSection _py_cs;
@@ -150,7 +148,8 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
150148
151149
Ends the critical section and releases the per-object lock.
152150
153-
In the free-threaded build, this macro expands to::
151+
In the free-threaded build, and when building for the
152+
:ref:`Stable ABI <stable-abi>`, this macro expands to::
154153
155154
PyCriticalSection_End(&_py_cs);
156155
}
@@ -179,7 +178,8 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
179178
180179
Locks the mutexes *m1* and *m2* and begins a critical section.
181180
182-
In the free-threaded build, this macro expands to::
181+
In the free-threaded build, and when building for the
182+
:ref:`Stable ABI <stable-abi>`, this macro expands to::
183183
184184
{
185185
PyCriticalSection2 _py_cs2;
@@ -196,7 +196,8 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
196196
197197
Ends the critical section and releases the per-object locks.
198198
199-
In the free-threaded build, this macro expands to::
199+
In the free-threaded build, and when building for the
200+
:ref:`Stable ABI <stable-abi>`, this macro expands to::
200201
201202
PyCriticalSection2_End(&_py_cs2);
202203
}
@@ -205,6 +206,48 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
205206
206207
.. versionadded:: 3.13
207208
209+
Low-level critical section API
210+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211+
212+
The following functions and structs are exposed for cases where C macros
213+
are not available.
214+
215+
.. c:function:: void PyCriticalSection_Begin(PyCriticalSection *c, PyObject *op)
216+
void PyCriticalSection_End(PyCriticalSection *c)
217+
void PyCriticalSection2_Begin(PyCriticalSection2 *c, PyObject *a, PyObject *b)
218+
void PyCriticalSection2_End(PyCriticalSection2 *c);
219+
220+
To be used only as in the macro expansions
221+
listed :ref:`earlier in this section <critical-section-macros>`.
222+
223+
In non-:term:`free-threaded <free threading>` builds of CPython, these
224+
functions do nothing.
225+
226+
.. versionadded:: 3.13
227+
228+
.. c:type:: PyCriticalSection
229+
PyCriticalSection2
230+
231+
To be used only as in the macro expansions
232+
listed :ref:`earlier in this section <critical-section-macros>`.
233+
Note that the contents of the structures are private and their meaning may
234+
change in future Python versions.
235+
236+
.. versionadded:: 3.13
237+
238+
.. c:function:: void PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *m);
239+
void PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2);
240+
241+
.. (These need to be in a separate section without a Stable ABI anotation.)
242+
243+
To be used only as in the macro expansions
244+
listed :ref:`earlier in this section <critical-section-macros>`.
245+
246+
In non-:term:`free-threaded <free threading>` builds of CPython, these
247+
functions do nothing.
248+
249+
.. versionadded:: 3.14
250+
208251
209252
Legacy locking APIs
210253
-------------------

Doc/data/stable_abi.dat

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ Pending removal in Python 3.19
2222
supported depending on the backend implementation of hash functions.
2323
Prefer passing the initial data as a positional argument for maximum
2424
backwards compatibility.
25+
26+
* :mod:`http.cookies`:
27+
28+
* :meth:`http.cookies.Morsel.js_output` is deprecated and will be
29+
removed in Python 3.19.
30+
31+
* :meth:`http.cookies.BaseCookie.js_output` is deprecated and will be
32+
removed in Python 3.19.
33+

Doc/library/array.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ defined:
4848
+-----------+--------------------+-------------------+-----------------------+-------+
4949
| ``'d'`` | double | float | 8 | |
5050
+-----------+--------------------+-------------------+-----------------------+-------+
51-
| ``'F'`` | float complex | complex | 8 | \(4) |
51+
| ``'Zf'`` | float complex | complex | 8 | \(4) |
5252
+-----------+--------------------+-------------------+-----------------------+-------+
53-
| ``'D'`` | double complex | complex | 16 | \(4) |
53+
| ``'Zd'`` | double complex | complex | 16 | \(4) |
5454
+-----------+--------------------+-------------------+-----------------------+-------+
5555

5656

@@ -80,7 +80,7 @@ Notes:
8080
.. versionadded:: 3.15
8181

8282
(4)
83-
Complex types (``F`` and ``D``) are available unconditionally,
83+
Complex types (``Zf`` and ``Zd``) are available unconditionally,
8484
regardless on support for complex types (the Annex G of the C11 standard)
8585
by the C compiler.
8686
As specified in the C11 standard, each complex type is represented by a
@@ -105,7 +105,10 @@ The module defines the following item:
105105

106106
.. data:: typecodes
107107

108-
A string with all available type codes.
108+
A tuple with all available type codes.
109+
110+
.. versionchanged:: next
111+
The type changed from :class:`str` to :class:`tuple`.
109112

110113

111114
The module defines the following type:

Doc/library/calendar.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,11 @@ The following options are accepted:
756756
By default, today's date is highlighted in color and can be
757757
:ref:`controlled using environment variables <using-on-controlling-color>`.
758758

759+
.. versionchanged:: next
760+
By default, the month is now also highlighted in color, and
761+
the days of the week are also in color. This behavior can be
762+
:ref:`controlled using environment variables <using-on-controlling-color>`.
763+
759764
*HTML-mode options:*
760765

761766
.. option:: --css CSS, -c CSS

Doc/library/ctypes.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,19 @@ in both C and ``libffi``, the following complex types are available:
370370
* - :class:`c_float_complex`
371371
- :c:expr:`float complex`
372372
- :py:class:`complex`
373-
- ``'F'``
373+
- ``'Zf'``
374374
* - :class:`c_double_complex`
375375
- :c:expr:`double complex`
376376
- :py:class:`complex`
377-
- ``'D'``
377+
- ``'Zd'``
378378
* - :class:`c_longdouble_complex`
379379
- :c:expr:`long double complex`
380380
- :py:class:`complex`
381-
- ``'G'``
381+
- ``'Zg'``
382+
383+
.. versionchanged:: next
384+
The :py:attr:`~_SimpleCData._type_` types ``F``, ``D`` and ``G`` have been
385+
replaced with ``Zf``, ``Zd`` and ``Zg``.
382386

383387

384388
All these types can be created by calling them with an optional initializer of

Doc/library/http.cookies.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ Cookie Objects
107107

108108
The meaning for *attrs* is the same as in :meth:`output`.
109109

110+
.. deprecated-removed:: 3.15 3.19
111+
This method generates a JavaScript snippet to set cookies in the browser,
112+
which is no longer considered a standard or recommended approach.
113+
Use :meth:`~http.cookies.BaseCookie.output` instead to generate HTTP
114+
headers.
115+
110116

111117
.. method:: BaseCookie.load(rawdata)
112118

@@ -223,6 +229,12 @@ Morsel Objects
223229

224230
The meaning for *attrs* is the same as in :meth:`output`.
225231

232+
.. deprecated-removed:: 3.15 3.19
233+
This method generates a JavaScript snippet to set cookies in the browser,
234+
which is no longer considered a standard or recommended approach.
235+
Use :meth:`~http.cookies.Morsel.output` instead to generate HTTP
236+
headers.
237+
226238

227239
.. method:: Morsel.OutputString(attrs=None)
228240

Doc/library/inspect.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,8 +1833,15 @@ from the command line.
18331833

18341834
By default, accepts the name of a module and prints the source of that
18351835
module. A class or function within the module can be printed instead by
1836-
appended a colon and the qualified name of the target object.
1836+
appending a colon and the qualified name of the target object.
18371837

18381838
.. option:: --details
18391839

18401840
Print information about the specified object rather than the source code
1841+
1842+
.. versionchanged:: next
1843+
1844+
The ``--details`` option now supports basic introspection for modules
1845+
without available source code and indicates when modules are frozen.
1846+
It also indicates when the given target reference is not the canonical
1847+
name of the referenced object.

Doc/library/ipaddress.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ write code that handles both IP versions correctly. Address objects are
367367

368368
.. attribute:: ipv4_mapped
369369

370-
For addresses that appear to be IPv4 mapped addresses (starting with
371-
``::FFFF/96``), this property will report the embedded IPv4 address.
372-
For any other address, this property will be ``None``.
370+
For addresses that appear to be IPv4 mapped addresses in the range
371+
``::FFFF:0:0/96`` as defined by :RFC:`4291`, this property reports the
372+
embedded IPv4 address. For any other address, this property will be ``None``.
373373

374374
.. attribute:: scope_id
375375

0 commit comments

Comments
 (0)