Skip to content

Commit 86860c8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into zstd-set-params
2 parents 1fb521a + cf8941c commit 86860c8

File tree

90 files changed

+3953
-1604
lines changed

Some content is hidden

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

90 files changed

+3953
-1604
lines changed

Doc/c-api/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bound into a function.
182182
Type of a code object watcher callback function.
183183
184184
If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked
185-
after `co` has been fully initialized. Otherwise, the callback is invoked
185+
after *co* has been fully initialized. Otherwise, the callback is invoked
186186
before the destruction of *co* takes place, so the prior state of *co*
187187
can be inspected.
188188

Doc/c-api/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ There are a few functions specific to Python functions.
169169
unpredictable effects, including infinite recursion.
170170
171171
If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked
172-
after `func` has been fully initialized. Otherwise, the callback is invoked
172+
after *func* has been fully initialized. Otherwise, the callback is invoked
173173
before the modification to *func* takes place, so the prior state of *func*
174174
can be inspected. The runtime is permitted to optimize away the creation of
175175
function objects when possible. In such cases no event will be emitted.

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
12381238

12391239
.. c:macro:: Py_TPFLAGS_MANAGED_DICT
12401240
1241-
This bit indicates that instances of the class have a `~object.__dict__`
1241+
This bit indicates that instances of the class have a :attr:`~object.__dict__`
12421242
attribute, and that the space for the dictionary is managed by the VM.
12431243

12441244
If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set.

Doc/howto/free-threading-extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ The wheels, shared libraries, and binaries are indicated by a ``t`` suffix.
396396
free-threaded build, with the ``t`` suffix, such as ``python3.13t``.
397397
* `pypa/cibuildwheel <https://github.com/pypa/cibuildwheel>`_ supports the
398398
free-threaded build if you set
399-
`CIBW_FREE_THREADED_SUPPORT <https://cibuildwheel.pypa.io/en/stable/options/#free-threaded-support>`_.
399+
`CIBW_ENABLE to cpython-freethreading <https://cibuildwheel.pypa.io/en/stable/options/#enable>`_.
400400

401401
Limited C API and Stable ABI
402402
............................

Doc/library/annotationlib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ Classes
211211
means may not have any information about their scope, so passing
212212
arguments to this method may be necessary to evaluate them successfully.
213213

214+
If no *owner*, *globals*, *locals*, or *type_params* are provided and the
215+
:class:`~ForwardRef` does not contain information about its origin,
216+
empty globals and locals dictionaries are used.
217+
214218
.. versionadded:: 3.14
215219

216220

Doc/library/multiprocessing.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ Miscellaneous
10811081
.. function:: freeze_support()
10821082

10831083
Add support for when a program which uses :mod:`multiprocessing` has been
1084-
frozen to produce a Windows executable. (Has been tested with **py2exe**,
1084+
frozen to produce an executable. (Has been tested with **py2exe**,
10851085
**PyInstaller** and **cx_Freeze**.)
10861086

10871087
One needs to call this function straight after the ``if __name__ ==
@@ -1099,10 +1099,10 @@ Miscellaneous
10991099
If the ``freeze_support()`` line is omitted then trying to run the frozen
11001100
executable will raise :exc:`RuntimeError`.
11011101

1102-
Calling ``freeze_support()`` has no effect when invoked on any operating
1103-
system other than Windows. In addition, if the module is being run
1104-
normally by the Python interpreter on Windows (the program has not been
1105-
frozen), then ``freeze_support()`` has no effect.
1102+
Calling ``freeze_support()`` has no effect when the start method is not
1103+
*spawn*. In addition, if the module is being run normally by the Python
1104+
interpreter (the program has not been frozen), then ``freeze_support()``
1105+
has no effect.
11061106

11071107
.. function:: get_all_start_methods()
11081108

Doc/library/typing.rst

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,20 +3500,11 @@ Introspection helpers
35003500
Evaluate an :class:`annotationlib.ForwardRef` as a :term:`type hint`.
35013501

35023502
This is similar to calling :meth:`annotationlib.ForwardRef.evaluate`,
3503-
but unlike that method, :func:`!evaluate_forward_ref` also:
3504-
3505-
* Recursively evaluates forward references nested within the type hint.
3506-
* Raises :exc:`TypeError` when it encounters certain objects that are
3507-
not valid type hints.
3508-
* Replaces type hints that evaluate to :const:`!None` with
3509-
:class:`types.NoneType`.
3510-
* Supports the :attr:`~annotationlib.Format.FORWARDREF` and
3511-
:attr:`~annotationlib.Format.STRING` formats.
3503+
but unlike that method, :func:`!evaluate_forward_ref` also
3504+
recursively evaluates forward references nested within the type hint.
35123505

35133506
See the documentation for :meth:`annotationlib.ForwardRef.evaluate` for
3514-
the meaning of the *owner*, *globals*, *locals*, and *type_params* parameters.
3515-
*format* specifies the format of the annotation and is a member of
3516-
the :class:`annotationlib.Format` enum.
3507+
the meaning of the *owner*, *globals*, *locals*, *type_params*, and *format* parameters.
35173508

35183509
.. versionadded:: 3.14
35193510

Include/cpython/pystate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ typedef struct _stack_chunk {
6161
PyObject * data[1]; /* Variable sized */
6262
} _PyStackChunk;
6363

64+
/* Minimum size of data stack chunk */
65+
#define _PY_DATA_STACK_CHUNK_SIZE (16*1024)
6466
struct _ts {
6567
/* See Python/ceval.c for comments explaining most fields */
6668

Include/internal/pycore_debug_offsets.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ extern "C" {
5454
# define _Py_Debug_Free_Threaded 1
5555
# define _Py_Debug_code_object_co_tlbc offsetof(PyCodeObject, co_tlbc)
5656
# define _Py_Debug_interpreter_frame_tlbc_index offsetof(_PyInterpreterFrame, tlbc_index)
57+
# define _Py_Debug_interpreter_state_tlbc_generation offsetof(PyInterpreterState, tlbc_indices.tlbc_generation)
5758
#else
5859
# define _Py_Debug_gilruntimestate_enabled 0
5960
# define _Py_Debug_Free_Threaded 0
6061
# define _Py_Debug_code_object_co_tlbc 0
6162
# define _Py_Debug_interpreter_frame_tlbc_index 0
63+
# define _Py_Debug_interpreter_state_tlbc_generation 0
6264
#endif
6365

6466

@@ -89,6 +91,8 @@ typedef struct _Py_DebugOffsets {
8991
uint64_t gil_runtime_state_enabled;
9092
uint64_t gil_runtime_state_locked;
9193
uint64_t gil_runtime_state_holder;
94+
uint64_t code_object_generation;
95+
uint64_t tlbc_generation;
9296
} interpreter_state;
9397

9498
// Thread state offset;
@@ -216,6 +220,11 @@ typedef struct _Py_DebugOffsets {
216220
uint64_t gi_frame_state;
217221
} gen_object;
218222

223+
struct _llist_node {
224+
uint64_t next;
225+
uint64_t prev;
226+
} llist_node;
227+
219228
struct _debugger_support {
220229
uint64_t eval_breaker;
221230
uint64_t remote_debugger_support;
@@ -251,6 +260,8 @@ typedef struct _Py_DebugOffsets {
251260
.gil_runtime_state_enabled = _Py_Debug_gilruntimestate_enabled, \
252261
.gil_runtime_state_locked = offsetof(PyInterpreterState, _gil.locked), \
253262
.gil_runtime_state_holder = offsetof(PyInterpreterState, _gil.last_holder), \
263+
.code_object_generation = offsetof(PyInterpreterState, _code_object_generation), \
264+
.tlbc_generation = _Py_Debug_interpreter_state_tlbc_generation, \
254265
}, \
255266
.thread_state = { \
256267
.size = sizeof(PyThreadState), \
@@ -347,6 +358,10 @@ typedef struct _Py_DebugOffsets {
347358
.gi_iframe = offsetof(PyGenObject, gi_iframe), \
348359
.gi_frame_state = offsetof(PyGenObject, gi_frame_state), \
349360
}, \
361+
.llist_node = { \
362+
.next = offsetof(struct llist_node, next), \
363+
.prev = offsetof(struct llist_node, prev), \
364+
}, \
350365
.debugger_support = { \
351366
.eval_breaker = offsetof(PyThreadState, eval_breaker), \
352367
.remote_debugger_support = offsetof(PyThreadState, remote_debugger_support), \

Include/internal/pycore_global_objects_fini_generated.h

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

0 commit comments

Comments
 (0)