Skip to content

Commit c02d8ef

Browse files
authored
Merge branch 'main' into fix-test-ucn-rw
2 parents 79dabbb + 27d1443 commit c02d8ef

24 files changed

+493
-378
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 2 additions & 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ struct _Py_global_strings {
283283
STRUCT_FOR_ID(aggregate_class)
284284
STRUCT_FOR_ID(alias)
285285
STRUCT_FOR_ID(align)
286+
STRUCT_FOR_ID(all)
286287
STRUCT_FOR_ID(allow_code)
288+
STRUCT_FOR_ID(any)
287289
STRUCT_FOR_ID(append)
288290
STRUCT_FOR_ID(arg)
289291
STRUCT_FOR_ID(argdefs)

Include/internal/pycore_interp_structs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99

1010
#include "pycore_ast_state.h" // struct ast_state
1111
#include "pycore_llist.h" // struct llist_node
12+
#include "pycore_opcode_utils.h" // NUM_COMMON_CONSTANTS
1213
#include "pycore_pymath.h" // _PY_SHORT_FLOAT_REPR
1314
#include "pycore_structs.h" // PyHamtObject
1415
#include "pycore_tstate.h" // _PyThreadStateImpl
@@ -912,6 +913,7 @@ struct _is {
912913
struct ast_state ast;
913914
struct types_state types;
914915
struct callable_cache callable_cache;
916+
PyObject *common_consts[NUM_COMMON_CONSTANTS];
915917
bool jit;
916918
struct _PyExecutorObject *executor_list_head;
917919
size_t trace_run_counter;

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ Known values:
272272
Python 3.14a6 3617 (Branch monitoring for async for loops)
273273
Python 3.14a6 3618 (Add oparg to END_ASYNC_FOR)
274274
Python 3.14a6 3619 (Renumber RESUME opcode from 149 to 128)
275+
Python 3.14a6 3620 (Optimize bytecode for all/any/tuple called on a genexp)
275276
276277
Python 3.15 will start with 3650
277278
@@ -284,7 +285,7 @@ PC/launcher.c must also be updated.
284285
285286
*/
286287

287-
#define PYC_MAGIC_NUMBER 3619
288+
#define PYC_MAGIC_NUMBER 3620
288289
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
289290
(little-endian) and then appending b'\r\n'. */
290291
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_utils.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "opcode_ids.h"
12-
1311
#define MAX_REAL_OPCODE 254
1412

1513
#define IS_WITHIN_OPCODE_RANGE(opcode) \
@@ -67,7 +65,10 @@ extern "C" {
6765
/* Values used as the oparg for LOAD_COMMON_CONSTANT */
6866
#define CONSTANT_ASSERTIONERROR 0
6967
#define CONSTANT_NOTIMPLEMENTEDERROR 1
70-
#define NUM_COMMON_CONSTANTS 2
68+
#define CONSTANT_BUILTIN_TUPLE 2
69+
#define CONSTANT_BUILTIN_ALL 3
70+
#define CONSTANT_BUILTIN_ANY 4
71+
#define NUM_COMMON_CONSTANTS 5
7172

7273
/* Values used in the oparg for RESUME */
7374
#define RESUME_AT_FUNC_START 0

Include/internal/pycore_runtime_init_generated.h

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

Include/internal/pycore_unicodeobject_generated.h

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

Lib/opcode.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasarg", "hasconst", "hasname",
1010
"hasjump", "hasjrel", "hasjabs", "hasfree", "haslocal", "hasexc"]
1111

12+
import builtins
1213
import _opcode
1314
from _opcode import stack_effect
1415

@@ -38,7 +39,8 @@
3839
_intrinsic_1_descs = _opcode.get_intrinsic1_descs()
3940
_intrinsic_2_descs = _opcode.get_intrinsic2_descs()
4041
_special_method_names = _opcode.get_special_method_names()
41-
_common_constants = [AssertionError, NotImplementedError]
42+
_common_constants = [builtins.AssertionError, builtins.NotImplementedError,
43+
builtins.tuple, builtins.all, builtins.any]
4244
_nb_ops = _opcode.get_nb_ops()
4345

4446
hascompare = [opmap["COMPARE_OP"]]

Lib/test/libregrtest/tsan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# chosen because they use threads and run in a reasonable amount of time.
33

44
TSAN_TESTS = [
5-
'test_asyncio.test_free_threading',
5+
'test_asyncio',
66
# TODO: enable more of test_capi once bugs are fixed (GH-116908, GH-116909).
77
'test_capi.test_mem',
88
'test_capi.test_pyatomic',

Lib/test/test_annotationlib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def foo(a: int, b: str):
517517

518518
foo.__annotations__ = {"a": "foo", "b": "str"}
519519
for format in Format:
520-
if format is Format.VALUE_WITH_FAKE_GLOBALS:
520+
if format == Format.VALUE_WITH_FAKE_GLOBALS:
521521
continue
522522
with self.subTest(format=format):
523523
self.assertEqual(
@@ -816,7 +816,7 @@ def __annotations__(self):
816816

817817
wa = WeirdAnnotations()
818818
for format in Format:
819-
if format is Format.VALUE_WITH_FAKE_GLOBALS:
819+
if format == Format.VALUE_WITH_FAKE_GLOBALS:
820820
continue
821821
with (
822822
self.subTest(format=format),

0 commit comments

Comments
 (0)