Skip to content

Commit b69ebdd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into live-tui
2 parents 5035156 + a52c39e commit b69ebdd

41 files changed

Lines changed: 4729 additions & 3973 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/jit.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,9 @@ jobs:
5757
fail-fast: false
5858
matrix:
5959
target:
60-
# To re-enable later when we support these.
61-
# - i686-pc-windows-msvc/msvc
62-
# - x86_64-pc-windows-msvc/msvc
63-
# - aarch64-pc-windows-msvc/msvc
60+
- i686-pc-windows-msvc/msvc
61+
- x86_64-pc-windows-msvc/msvc
62+
- aarch64-pc-windows-msvc/msvc
6463
- x86_64-apple-darwin/clang
6564
- aarch64-apple-darwin/clang
6665
- x86_64-unknown-linux-gnu/gcc
@@ -71,16 +70,15 @@ jobs:
7170
llvm:
7271
- 21
7372
include:
74-
# To re-enable later when we support these.
75-
# - target: i686-pc-windows-msvc/msvc
76-
# architecture: Win32
77-
# runner: windows-2022
78-
# - target: x86_64-pc-windows-msvc/msvc
79-
# architecture: x64
80-
# runner: windows-2022
81-
# - target: aarch64-pc-windows-msvc/msvc
82-
# architecture: ARM64
83-
# runner: windows-11-arm
73+
- target: i686-pc-windows-msvc/msvc
74+
architecture: Win32
75+
runner: windows-2022
76+
- target: x86_64-pc-windows-msvc/msvc
77+
architecture: x64
78+
runner: windows-2022
79+
- target: aarch64-pc-windows-msvc/msvc
80+
architecture: ARM64
81+
runner: windows-11-arm
8482
- target: x86_64-apple-darwin/clang
8583
architecture: x86_64
8684
runner: macos-15-intel

Doc/c-api/dict.rst

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,3 +477,92 @@ Dictionary View Objects
477477
478478
Return true if *op* is an instance of a dictionary items view. This function
479479
always succeeds.
480+
481+
482+
Ordered Dictionaries
483+
^^^^^^^^^^^^^^^^^^^^
484+
485+
Python's C API provides interface for :class:`collections.OrderedDict` from C.
486+
Since Python 3.7, dictionaries are ordered by default, so there is usually
487+
little need for these functions; prefer ``PyDict*`` where possible.
488+
489+
490+
.. c:var:: PyTypeObject PyODict_Type
491+
492+
Type object for ordered dictionaries. This is the same object as
493+
:class:`collections.OrderedDict` in the Python layer.
494+
495+
496+
.. c:function:: int PyODict_Check(PyObject *od)
497+
498+
Return true if *od* is an ordered dictionary object or an instance of a
499+
subtype of the :class:`~collections.OrderedDict` type. This function
500+
always succeeds.
501+
502+
503+
.. c:function:: int PyODict_CheckExact(PyObject *od)
504+
505+
Return true if *od* is an ordered dictionary object, but not an instance of
506+
a subtype of the :class:`~collections.OrderedDict` type.
507+
This function always succeeds.
508+
509+
510+
.. c:var:: PyTypeObject PyODictKeys_Type
511+
512+
Analogous to :c:type:`PyDictKeys_Type` for ordered dictionaries.
513+
514+
515+
.. c:var:: PyTypeObject PyODictValues_Type
516+
517+
Analogous to :c:type:`PyDictValues_Type` for ordered dictionaries.
518+
519+
520+
.. c:var:: PyTypeObject PyODictItems_Type
521+
522+
Analogous to :c:type:`PyDictItems_Type` for ordered dictionaries.
523+
524+
525+
.. c:function:: PyObject *PyODict_New(void)
526+
527+
Return a new empty ordered dictionary, or ``NULL`` on failure.
528+
529+
This is analogous to :c:func:`PyDict_New`.
530+
531+
532+
.. c:function:: int PyODict_SetItem(PyObject *od, PyObject *key, PyObject *value)
533+
534+
Insert *value* into the ordered dictionary *od* with a key of *key*.
535+
Return ``0`` on success or ``-1`` with an exception set on failure.
536+
537+
This is analogous to :c:func:`PyDict_SetItem`.
538+
539+
540+
.. c:function:: int PyODict_DelItem(PyObject *od, PyObject *key)
541+
542+
Remove the entry in the ordered dictionary *od* with key *key*.
543+
Return ``0`` on success or ``-1`` with an exception set on failure.
544+
545+
This is analogous to :c:func:`PyDict_DelItem`.
546+
547+
548+
These are :term:`soft deprecated` aliases to ``PyDict`` APIs:
549+
550+
551+
.. list-table::
552+
:widths: auto
553+
:header-rows: 1
554+
555+
* * ``PyODict``
556+
* ``PyDict``
557+
* * .. c:macro:: PyODict_GetItem(od, key)
558+
* :c:func:`PyDict_GetItem`
559+
* * .. c:macro:: PyODict_GetItemWithError(od, key)
560+
* :c:func:`PyDict_GetItemWithError`
561+
* * .. c:macro:: PyODict_GetItemString(od, key)
562+
* :c:func:`PyDict_GetItemString`
563+
* * .. c:macro:: PyODict_Contains(od, key)
564+
* :c:func:`PyDict_Contains`
565+
* * .. c:macro:: PyODict_Size(od)
566+
* :c:func:`PyDict_Size`
567+
* * .. c:macro:: PyODict_SIZE(od)
568+
* :c:func:`PyDict_GET_SIZE`

Doc/c-api/float.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Floating-Point Objects
8787
``<math.h>`` header.
8888
8989
.. deprecated:: 3.15
90-
The macro is soft deprecated.
90+
The macro is :term:`soft deprecated`.
9191
9292
9393
.. c:macro:: Py_NAN
@@ -99,6 +99,14 @@ Floating-Point Objects
9999
the C11 standard ``<math.h>`` header.
100100
101101
102+
.. c:macro:: Py_HUGE_VAL
103+
104+
Equivalent to :c:macro:`!INFINITY`.
105+
106+
.. deprecated:: 3.14
107+
The macro is :term:`soft deprecated`.
108+
109+
102110
.. c:macro:: Py_MATH_E
103111
104112
The definition (accurate for a :c:expr:`double` type) of the :data:`math.e` constant.
@@ -147,6 +155,34 @@ Floating-Point Objects
147155
return PyFloat_FromDouble(copysign(INFINITY, sign));
148156
149157
158+
.. c:macro:: Py_IS_FINITE(X)
159+
160+
Return ``1`` if the given floating-point number *X* is finite,
161+
that is, it is normal, subnormal or zero, but not infinite or NaN.
162+
Return ``0`` otherwise.
163+
164+
.. deprecated:: 3.14
165+
The macro is :term:`soft deprecated`. Use :c:macro:`!isfinite` instead.
166+
167+
168+
.. c:macro:: Py_IS_INFINITY(X)
169+
170+
Return ``1`` if the given floating-point number *X* is positive or negative
171+
infinity. Return ``0`` otherwise.
172+
173+
.. deprecated:: 3.14
174+
The macro is :term:`soft deprecated`. Use :c:macro:`!isinf` instead.
175+
176+
177+
.. c:macro:: Py_IS_NAN(X)
178+
179+
Return ``1`` if the given floating-point number *X* is a not-a-number (NaN)
180+
value. Return ``0`` otherwise.
181+
182+
.. deprecated:: 3.14
183+
The macro is :term:`soft deprecated`. Use :c:macro:`!isnan` instead.
184+
185+
150186
Pack and Unpack functions
151187
-------------------------
152188

Doc/c-api/intro.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ complete listing.
183183

184184
.. versionadded:: 3.6
185185

186+
.. c:macro:: Py_MEMCPY(dest, src, n)
187+
188+
This is a :term:`soft deprecated` alias to :c:func:`!memcpy`.
189+
Use :c:func:`!memcpy` directly instead.
190+
191+
.. deprecated:: 3.14
192+
The macro is :term:`soft deprecated`.
193+
186194
.. c:macro:: Py_MIN(x, y)
187195
188196
Return the minimum value between ``x`` and ``y``.

Doc/c-api/iterator.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ Other Iterator Objects
108108
.. c:var:: PyTypeObject PyDictRevIterValue_Type
109109
.. c:var:: PyTypeObject PyDictIterItem_Type
110110
.. c:var:: PyTypeObject PyDictRevIterItem_Type
111+
.. c:var:: PyTypeObject PyODictIter_Type
111112
112113
Type objects for iterators of various built-in objects.
113114

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ although there is currently no date scheduled for their removal.
7676
* :mod:`mailbox`: Use of StringIO input and text mode is deprecated, use
7777
BytesIO and binary mode instead.
7878

79-
* :mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process.
79+
* :mod:`os`: Calling :func:`os.register_at_fork` in a multi-threaded process.
8080

8181
* :class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is
8282
deprecated, use an exception instance.

Doc/library/decimal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ allows the settings to be changed. This approach meets the needs of most
264264
applications.
265265

266266
For more advanced work, it may be useful to create alternate contexts using the
267-
Context() constructor. To make an alternate active, use the :func:`setcontext`
267+
:meth:`Context` constructor. To make an alternate active, use the :func:`setcontext`
268268
function.
269269

270270
In accordance with the standard, the :mod:`decimal` module provides two ready to

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ process and user.
558558

559559
.. function:: initgroups(username, gid, /)
560560

561-
Call the system initgroups() to initialize the group access list with all of
561+
Call the system ``initgroups()`` to initialize the group access list with all of
562562
the groups of which the specified username is a member, plus the specified
563563
group id.
564564

Doc/whatsnew/3.15.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ Other language changes
316316
and compression. Common code patterns which can be optimized with
317317
:func:`~bytearray.take_bytes` are listed below.
318318

319-
(Contributed by Cody Maloney in :gh:`139871`.)
320-
321-
.. list-table:: Suggested Optimizing Refactors
319+
.. list-table:: Suggested optimizing refactors
322320
:header-rows: 1
323321

324322
* - Description
@@ -387,10 +385,12 @@ Other language changes
387385
buffer.resize(n)
388386
data = buffer.take_bytes()
389387

388+
(Contributed by Cody Maloney in :gh:`139871`.)
389+
390390
* Many functions related to compiling or parsing Python code, such as
391391
:func:`compile`, :func:`ast.parse`, :func:`symtable.symtable`,
392-
and :func:`importlib.abc.InspectLoader.source_to_code`, now allow to pass
393-
the module name. It is needed to unambiguous :ref:`filter <warning-filter>`
392+
and :func:`importlib.abc.InspectLoader.source_to_code`, now allow the module
393+
name to be passed. It is needed to unambiguously :ref:`filter <warning-filter>`
394394
syntax warnings by module name.
395395
(Contributed by Serhiy Storchaka in :gh:`135801`.)
396396

@@ -776,6 +776,17 @@ unittest
776776
(Contributed by Garry Cairns in :gh:`134567`.)
777777

778778

779+
venv
780+
----
781+
782+
* On POSIX platforms, platlib directories will be created if needed when
783+
creating virtual environments, instead of using ``lib64 -> lib`` symlink.
784+
This means purelib and platlib of virtual environments no longer share the
785+
same ``lib`` directory on platforms where :data:`sys.platlibdir` is not
786+
equal to ``lib``.
787+
(Contributed by Rui Xi in :gh:`133951`.)
788+
789+
779790
warnings
780791
--------
781792

@@ -788,17 +799,6 @@ warnings
788799
(Contributed by Serhiy Storchaka in :gh:`135801`.)
789800

790801

791-
venv
792-
----
793-
794-
* On POSIX platforms, platlib directories will be created if needed when
795-
creating virtual environments, instead of using ``lib64 -> lib`` symlink.
796-
This means purelib and platlib of virtual environments no longer share the
797-
same ``lib`` directory on platforms where :data:`sys.platlibdir` is not
798-
equal to ``lib``.
799-
(Contributed by Rui Xi in :gh:`133951`.)
800-
801-
802802
xml.parsers.expat
803803
-----------------
804804

@@ -1242,7 +1242,7 @@ Porting to Python 3.15
12421242
This section lists previously described changes and other bugfixes
12431243
that may require changes to your code.
12441244

1245-
* :class:`sqlite3.Connection` APIs has been cleaned up.
1245+
* :class:`sqlite3.Connection` APIs have been cleaned up.
12461246

12471247
* All parameters of :func:`sqlite3.connect` except *database* are now keyword-only.
12481248
* The first three parameters of methods :meth:`~sqlite3.Connection.create_function`
@@ -1262,7 +1262,7 @@ that may require changes to your code.
12621262
* :meth:`~mmap.mmap.resize` has been removed on platforms that don't support the
12631263
underlying syscall, instead of raising a :exc:`SystemError`.
12641264

1265-
* Resource warning is now emitted for unclosed
1265+
* A resource warning is now emitted for an unclosed
12661266
:func:`xml.etree.ElementTree.iterparse` iterator if it opened a file.
12671267
Use its :meth:`!close` method or the :func:`contextlib.closing` context
12681268
manager to close it.

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ Known values:
286286
Python 3.15a1 3653 (Fix handling of opcodes that may leave operands on the stack when optimizing LOAD_FAST)
287287
Python 3.15a1 3654 (Fix missing exception handlers in logical expression)
288288
Python 3.15a1 3655 (Fix miscompilation of some module-level annotations)
289+
Python 3.15a1 3656 (Add TRACE_RECORD instruction, for platforms with switch based interpreter)
289290
290291
291292
Python 3.16 will start with 3700
@@ -299,7 +300,7 @@ PC/launcher.c must also be updated.
299300
300301
*/
301302

302-
#define PYC_MAGIC_NUMBER 3655
303+
#define PYC_MAGIC_NUMBER 3656
303304
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
304305
(little-endian) and then appending b'\r\n'. */
305306
#define PYC_MAGIC_NUMBER_TOKEN \

0 commit comments

Comments
 (0)