Skip to content

Commit b289183

Browse files
authored
Merge branch 'main' into critical-section-stable-abi-xs
2 parents 9be8cb5 + 1e21cf6 commit b289183

43 files changed

Lines changed: 987 additions & 388 deletions

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/data/stable_abi.dat

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

Doc/library/array.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ defined:
5252
+-----------+--------------------+-------------------+-----------------------+-------+
5353
| ``'D'`` | double complex | complex | 16 | \(4) |
5454
+-----------+--------------------+-------------------+-----------------------+-------+
55+
| ``'Zf'`` | float complex | complex | 8 | \(4) |
56+
+-----------+--------------------+-------------------+-----------------------+-------+
57+
| ``'Zd'`` | double complex | complex | 16 | \(4) |
58+
+-----------+--------------------+-------------------+-----------------------+-------+
5559

5660

5761
Notes:
@@ -80,7 +84,7 @@ Notes:
8084
.. versionadded:: 3.15
8185

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

106110
.. data:: typecodes
107111

108-
A string with all available type codes.
112+
A tuple with all available type codes.
113+
114+
.. versionchanged:: next
115+
The type changed from :class:`str` to :class:`tuple`.
109116

110117

111118
The module defines the following type:

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/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

Doc/library/struct.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ platform-dependent.
264264
+--------+--------------------------+--------------------+----------------+------------+
265265
| ``D`` | :c:expr:`double complex` | complex | 16 | \(10) |
266266
+--------+--------------------------+--------------------+----------------+------------+
267+
| ``Zf`` | :c:expr:`float complex` | complex | 8 | \(10) |
268+
+--------+--------------------------+--------------------+----------------+------------+
269+
| ``Zd`` | :c:expr:`double complex` | complex | 16 | \(10) |
270+
+--------+--------------------------+--------------------+----------------+------------+
267271
| ``s`` | :c:expr:`char[]` | bytes | | \(9) |
268272
+--------+--------------------------+--------------------+----------------+------------+
269273
| ``p`` | :c:expr:`char[]` | bytes | | \(8) |
@@ -280,6 +284,9 @@ platform-dependent.
280284
.. versionchanged:: 3.14
281285
Added support for the ``'F'`` and ``'D'`` formats.
282286

287+
.. versionchanged:: next
288+
Added support for the ``'Zf'`` and ``'Zd'`` formats.
289+
283290
.. seealso::
284291

285292
The :mod:`array` and :ref:`ctypes <ctypes-fundamental-data-types>` modules,
@@ -372,7 +379,7 @@ Notes:
372379
For the ``'F'`` and ``'D'`` format characters, the packed representation uses
373380
the IEEE 754 binary32 and binary64 format for components of the complex
374381
number, regardless of the floating-point format used by the platform.
375-
Note that complex types (``F`` and ``D``) are available unconditionally,
382+
Note that complex types (``F``/``Zf`` and ``D``/``Zd``) are available unconditionally,
376383
despite complex types being an optional feature in C.
377384
As specified in the C11 standard, each complex type is represented by a
378385
two-element C array containing, respectively, the real and imaginary parts.

Doc/whatsnew/3.15.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,9 @@ Other language changes
671671
(Contributed by James Hilton-Balfe in :gh:`128335`.)
672672

673673
* The class :class:`memoryview` now supports the :c:expr:`float complex` and
674-
:c:expr:`double complex` C types: formatting characters ``'F'`` and ``'D'``
675-
respectively.
676-
(Contributed by Sergey B Kirpichev in :gh:`146151`.)
674+
:c:expr:`double complex` C types: formatting characters ``'F'``/``'Zf'``
675+
and ``'D'``/``'Zd'`` respectively.
676+
(Contributed by Victor Stinner in :gh:`146151` and :gh:`148675`.)
677677

678678
* Allow the *count* argument of :meth:`bytes.replace` to be a keyword.
679679
(Contributed by Stan Ulbrych in :gh:`147856`.)
@@ -724,13 +724,17 @@ array
724724
-----
725725

726726
* Support the :c:expr:`float complex` and :c:expr:`double complex` C types:
727-
formatting characters ``'F'`` and ``'D'`` respectively.
728-
(Contributed by Sergey B Kirpichev in :gh:`146151`.)
727+
formatting characters ``'F'``/``'Zf'`` and ``'D'``/``'Zd'`` respectively.
728+
(Contributed by Victor Stinner in :gh:`146151` and :gh:`148675`.)
729729

730730
* Support half-floats (16-bit IEEE 754 binary interchange format): formatting
731731
character ``'e'``.
732732
(Contributed by Sergey B Kirpichev in :gh:`146238`.)
733733

734+
* The :data:`array.typecodes` type changed from :class:`str` to :class:`tuple`
735+
to support type codes longer than 1 character (``Zf`` and ``Zd``).
736+
(Contributed by Victor Stinner in :gh:`148675`.)
737+
734738

735739
ast
736740
---
@@ -1741,6 +1745,12 @@ ctypes
17411745
which has been deprecated since Python 3.13.
17421746
(Contributed by Bénédikt Tran in :gh:`133866`.)
17431747

1748+
* Change the :py:attr:`~ctypes._SimpleCData._type_` of
1749+
:class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` and
1750+
:class:`~ctypes.c_longdouble_complex` from ``F``, ``D`` and ``G`` to ``Zf``,
1751+
``Zd`` and ``Zg`` for compatibility with numpy.
1752+
(Contributed by Victor Stinner in :gh:`148675`.)
1753+
17441754

17451755
datetime
17461756
--------
@@ -2050,6 +2060,10 @@ New features
20502060

20512061
(Contributed by Victor Stinner in :gh:`141510`.)
20522062

2063+
* Add :c:func:`PyObject_CallFinalizerFromDealloc` function to the limited C
2064+
API.
2065+
(Contributed by Victor Stinner in :gh:`146063`.)
2066+
20532067
* Add :c:func:`PySys_GetAttr`, :c:func:`PySys_GetAttrString`,
20542068
:c:func:`PySys_GetOptionalAttr`, and :c:func:`PySys_GetOptionalAttrString`
20552069
functions as replacements for :c:func:`PySys_GetObject`.

Include/cpython/object.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ Py_DEPRECATED(3.15) PyAPI_FUNC(PyObject*) _PyObject_GetAttrId(PyObject *, _Py_Id
307307

308308
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
309309
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
310-
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
311310

312311
PyAPI_FUNC(void) PyUnstable_Object_ClearWeakRefsNoCallbacks(PyObject *);
313312

Include/object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ PyAPI_FUNC(int) PyType_Freeze(PyTypeObject *type);
782782
#endif
783783

784784
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)
785+
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
785786
PyAPI_FUNC(PyObject *) PyType_GetModuleByToken(PyTypeObject *type,
786787
const void *token);
787788
PyAPI_FUNC(void *) PyObject_GetTypeData_DuringGC(PyObject *obj,

0 commit comments

Comments
 (0)