Skip to content

Commit f6038d0

Browse files
committed
gh-145857: Replace DELETE_GLOBAL with PUSH_NULL; STORE_GLOBAL
Changes: - Removed `DELETE_GLOBAL` opcode - Allowed `STORE_GLOBAL` to take a `NULL` value corresponding to deletion - Added test to `test_compiler_codegen.py`
1 parent fb8d8d9 commit f6038d0

File tree

17 files changed

+981
-1082
lines changed

17 files changed

+981
-1082
lines changed

Doc/library/dis.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,11 +1092,6 @@ iterations of the loop.
10921092
Works as :opcode:`STORE_NAME`, but stores the name as a global.
10931093

10941094

1095-
.. opcode:: DELETE_GLOBAL (namei)
1096-
1097-
Works as :opcode:`DELETE_NAME`, but deletes a global name.
1098-
1099-
11001095
.. opcode:: LOAD_CONST (consti)
11011096

11021097
Pushes ``co_consts[consti]`` onto the stack.

Include/internal/pycore_magic_number.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ Known values:
294294
Python 3.15a4 3661 (Lazy imports IMPORT_NAME opcode changes)
295295
Python 3.15a8 3662 (Add counter to RESUME)
296296
Python 3.15a8 3663 (Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER)
297+
Python 3.15a8 3664 (Replace DELETE_GLOBAL with PUSH_NULL; STORE_GLOBAL)
297298
298299
299300
Python 3.16 will start with 3700
@@ -307,7 +308,7 @@ PC/launcher.c must also be updated.
307308
308309
*/
309310

310-
#define PYC_MAGIC_NUMBER 3663
311+
#define PYC_MAGIC_NUMBER 3664
311312
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
312313
(little-endian) and then appending b'\r\n'. */
313314
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)