Skip to content

Commit 86746bd

Browse files
authored
Merge branch 'main' into feat/zlib/crc32-combine-134635
2 parents 2c34e5f + 71290a6 commit 86746bd

File tree

92 files changed

+4369
-1796
lines changed

Some content is hidden

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

92 files changed

+4369
-1796
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/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/copy.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ and only supports named tuples created by :func:`~collections.namedtuple`,
122122
This method should create a new object of the same type,
123123
replacing fields with values from *changes*.
124124

125+
.. versionadded:: 3.13
126+
125127

126128
.. seealso::
127129

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.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ struct _Py_global_strings {
286286
STRUCT_FOR_ID(alias)
287287
STRUCT_FOR_ID(align)
288288
STRUCT_FOR_ID(all)
289+
STRUCT_FOR_ID(all_threads)
289290
STRUCT_FOR_ID(allow_code)
290291
STRUCT_FOR_ID(any)
291292
STRUCT_FOR_ID(append)

0 commit comments

Comments
 (0)