Skip to content

Commit 1ce4700

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Sync pre-release CPython main branch from GitHub (2026-10-14)
Summary: Imported python/cpython `3.16.0a1+dev` from upstream rev [`32fd69b`](https://www.github.com/python/cpython/commit/32fd69bdea00ce4dc24959734cc0d9284eb52f1e) (committed 2026-10-14 03:36:44+00:00). # Commit Info - Base: (`3.16.0a0`) - [`c6c0608`](https://www.github.com/python/cpython/commit/c6c060843b7635b5a1f82e0983d803eb0d185b5d) (commit date: 2026-10-10 23:12:35+00:00) - Imported: (`3.16.0a1+dev`) - [`32fd69b`](https://www.github.com/python/cpython/commit/32fd69bdea00ce4dc24959734cc0d9284eb52f1e) (commit date: 2026-10-14 03:36:44+00:00) # Noteworthy file changes - Test files (1 added) - Low-signal files (7 added, 1055 removed) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GJksrjALCZsXUaYFAFf1r5rhevhbbr0LAAAz Reviewed By: itamaro Differential Revision: D125154486 fbshipit-source-id: 4119629a1aaab74a61eaad8d8a149fd507193e44
1 parent 802a4fc commit 1ce4700

1,233 files changed

Lines changed: 16875 additions & 5106 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.

‎Doc/builtins/functions.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ are always available. They are listed here in alphabetical order.
110110

111111
.. versionadded:: 3.10
112112

113-
.. versionchanged:: next
113+
.. versionchanged:: 3.16
114114
Added the *stop_value* and *stop_exception* parameters.
115115

116116
.. function:: all(iterable, /)
@@ -1241,7 +1241,7 @@ are always available. They are listed here in alphabetical order.
12411241
for item in iter(input_queue.get_nowait, stop_exception=queue.Empty):
12421242
process_item(item)
12431243

1244-
.. versionchanged:: next
1244+
.. versionchanged:: 3.16
12451245
Added the *stop_exception* parameter
12461246
and allowed passing *stop_value* by keyword.
12471247

‎Doc/builtins/stdtypes.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5254,7 +5254,7 @@ copying.
52545254
.. versionchanged:: 3.5
52555255
The source format is no longer restricted when casting to a byte view.
52565256

5257-
.. versionchanged:: next
5257+
.. versionchanged:: 3.16
52585258
Casting a multi-dimensional F-contiguous view to a one-dimensional
52595259
view is now supported.
52605260

@@ -5331,7 +5331,7 @@ copying.
53315331

53325332
.. versionadded:: 3.3
53335333

5334-
.. versionchanged:: next
5334+
.. versionchanged:: 3.16
53355335
Added the *order* parameter.
53365336

53375337
.. attribute:: readonly

‎Doc/c-api/capsule.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Refer to :ref:`using-capsules` for more information on using these objects.
119119
.. versionchanged:: 3.3
120120
*no_block* has no effect anymore.
121121
122-
.. versionchanged:: next
122+
.. versionchanged:: 3.16
123123
Submodules are now imported if needed.
124124
125125

‎Doc/c-api/complex.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,5 @@ the :ref:`Number Protocol <number>` API or use native complex types, like
198198
199199
.. deprecated:: 3.15
200200
201-
.. versionchanged:: next
201+
.. versionchanged:: 3.16
202202
This function leaves :c:data:`errno` unchanged on success.

‎Doc/c-api/import.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ Importing Modules
417417
(Custom importers should do this in their
418418
:py:meth:`~importlib.abc.Loader.exec_module` method.)
419419
420+
If the spec's name is dotted and *initfunc* creates the module using only
421+
the last component of the name, the module's :attr:`~module.__name__`
422+
is set to the full name from the spec.
423+
420424
On error, return NULL with an exception set.
421425
422426
.. versionadded:: 3.15

‎Doc/c-api/init_config.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Error Handling
123123
Python 3.16. Instead, the option is now processed in :c:func:`Py_RunMain`.
124124
This function became useless.
125125
126-
.. deprecated:: next
126+
.. deprecated:: 3.16
127127
128128
129129
Get Options
@@ -247,7 +247,7 @@ Initialize Python
247247
* Return ``0`` on success.
248248
* Set an error in *config* and return ``-1`` on error.
249249
250-
.. versionchanged:: next
250+
.. versionchanged:: 3.16
251251
The function no longer sets an exit code if a command line option wants
252252
to exit Python. Instead, the option is now processed in
253253
:c:func:`Py_RunMain`.
@@ -623,7 +623,7 @@ Some options are read from the :mod:`sys` attributes. For example, the option
623623
624624
.. versionadded:: 3.14
625625
626-
.. versionchanged:: next
626+
.. versionchanged:: 3.16
627627
The function now replaces :data:`sys.flags` (create a new object),
628628
instead of modifying :data:`sys.flags` in-place.
629629
@@ -755,7 +755,7 @@ PyStatus
755755
756756
Exit code. Argument passed to ``exit()``.
757757
758-
.. deprecated:: next
758+
.. deprecated:: 3.16
759759
760760
.. c:member:: const char *err_msg
761761
@@ -787,7 +787,7 @@ PyStatus
787787
788788
Exit Python with the specified exit code.
789789
790-
.. deprecated:: next
790+
.. deprecated:: 3.16
791791
:c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
792792
command line option wants to exit Python. Instead, the option is
793793
now processed in :c:func:`Py_RunMain`.
@@ -807,7 +807,7 @@ PyStatus
807807
808808
Is the result an exit?
809809
810-
.. deprecated:: next
810+
.. deprecated:: 3.16
811811
:c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
812812
command line option wants to exit Python. Instead, the option is
813813
now processed in :c:func:`Py_RunMain`.

‎Doc/c-api/interp-lifecycle.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Initializing and finalizing the interpreter
127127
interpreter, populating the runtime configuration structure, and querying
128128
the returned status structure.
129129
130-
.. versionchanged:: next
130+
.. versionchanged:: 3.16
131131
The function no longer returns an exit code if a command line option
132132
wants to exit Python. Instead, the option is processed in
133133
:c:func:`Py_RunMain`.

‎Doc/c-api/marshal.rst‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following exceptions can be raised by these functions:
2424
:exc:`KeyboardInterrupt` if reading or writing is interrupted by a signal,
2525
and :exc:`MemoryError` if memory allocation fails.
2626

27-
.. versionchanged:: next
27+
.. versionchanged:: 3.16
2828
Previously, in functions taking a :c:expr:`FILE*`,
2929
the reading functions raised :exc:`EOFError`
3030
instead of :exc:`OSError` and :exc:`KeyboardInterrupt`,
@@ -43,14 +43,40 @@ and :exc:`MemoryError` if memory allocation fails.
4343
This function can fail, in which case it sets the error indicator.
4444
Use :c:func:`PyErr_Occurred` to check for that.
4545
46+
.. note::
47+
48+
In Python 3.15 and earlier, this function does not set the error
49+
indicator if writing to *file* fails.
50+
The same caveat applies as for :c:func:`PyMarshal_WriteObjectToFile`.
51+
4652
.. c:function:: void PyMarshal_WriteObjectToFile(PyObject *value, FILE *file, int version)
4753
4854
Marshal a Python object, *value*, to *file*.
4955
*version* indicates the file format.
5056
57+
The marshalled representation of *value* is built in memory
58+
and then written to *file*.
59+
Nothing is written if *value* cannot be marshalled.
60+
5161
This function can fail, in which case it sets the error indicator.
5262
Use :c:func:`PyErr_Occurred` to check for that.
5363
64+
.. note::
65+
66+
In Python 3.15 and earlier, this function can write only part of the
67+
data to *file* and return without setting the error indicator, for
68+
example if *value* contains an object which cannot be marshalled or
69+
if writing to *file* fails (see :gh:`155907`).
70+
Code which has to support these versions cannot rely on
71+
:c:func:`PyErr_Occurred` alone to know that all the data was written.
72+
It can use :c:func:`PyMarshal_WriteObjectToString` and write the
73+
result itself, or validate what was written.
74+
75+
.. versionchanged:: 3.16
76+
Previously, the data was written to *file* as it was produced,
77+
using a buffer of constant size,
78+
and incomplete data was written if *value* could not be marshalled.
79+
5480
.. c:function:: PyObject* PyMarshal_WriteObjectToString(PyObject *value, int version)
5581
5682
Return a bytes object containing the marshalled representation of *value*.

‎Doc/c-api/unicode.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ Python does not always check these requirements.
19451945
19461946
.. versionadded:: 3.3
19471947
1948-
.. soft-deprecated:: next
1948+
.. soft-deprecated:: 3.16
19491949
See :ref:`pyunicode-new-mutating`.
19501950
19511951
@@ -1968,7 +1968,7 @@ Python does not always check these requirements.
19681968
19691969
.. versionadded:: 3.3
19701970
1971-
.. soft-deprecated:: next
1971+
.. soft-deprecated:: 3.16
19721972
Use the :c:type:`PyUnicodeWriter` API instead.
19731973
19741974
@@ -1988,7 +1988,7 @@ Python does not always check these requirements.
19881988
19891989
.. versionadded:: 3.3
19901990
1991-
.. soft-deprecated:: next
1991+
.. soft-deprecated:: 3.16
19921992
Use the :c:type:`PyUnicodeWriter` API instead.
19931993
19941994
@@ -2009,7 +2009,7 @@ Python does not always check these requirements.
20092009
*\*unicode* must not be "used" yet.
20102010
See :ref:`pyunicode-new-mutating` for details.
20112011
2012-
.. soft-deprecated:: next
2012+
.. soft-deprecated:: 3.16
20132013
Use the :c:type:`PyUnicodeWriter` API instead.
20142014
20152015
@@ -2030,7 +2030,7 @@ Python does not always check these requirements.
20302030
20312031
.. versionadded:: 3.3
20322032
2033-
.. soft-deprecated:: next
2033+
.. soft-deprecated:: 3.16
20342034
Use the :c:type:`PyUnicodeWriter` API instead.
20352035
20362036
@@ -2050,5 +2050,5 @@ Python does not always check these requirements.
20502050
20512051
.. versionadded:: 3.3
20522052
2053-
.. soft-deprecated:: next
2053+
.. soft-deprecated:: 3.16
20542054
Use the :c:type:`PyUnicodeWriter` API instead.

‎Doc/c-api/weakref.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ as much as it can.
4545
weakly referenceable object, or if *callback* is not callable, ``None``, or
4646
``NULL``, this will raise :exc:`TypeError` and return ``NULL``.
4747
48-
.. versionchanged:: next
48+
.. versionchanged:: 3.16
4949
Raise :exc:`!TypeError` if *callback* is not callable, ``None``, or
5050
``NULL``.
5151
@@ -65,7 +65,7 @@ as much as it can.
6565
is not a weakly referenceable object, or if *callback* is not callable,
6666
``NULL``, this will raise :exc:`TypeError` and return ``NULL``.
6767
68-
.. versionchanged:: next
68+
.. versionchanged:: 3.16
6969
Raise :exc:`!TypeError` if *callback* is not callable, ``None``, or
7070
``NULL``.
7171

0 commit comments

Comments
 (0)