Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1547,17 +1547,6 @@ iterations of the loop.
``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`.


.. opcode:: DELETE_DEREF (i)

Empties the cell contained in slot ``i`` of the "fast locals" storage.
Used by the :keyword:`del` statement.

.. versionadded:: 3.2

.. versionchanged:: 3.11
``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`.


.. opcode:: COPY_FREE_VARS (n)

Copies the ``n`` :term:`free (closure) variables <closure variable>` from the closure
Expand Down
1 change: 1 addition & 0 deletions Doc/tools/removed-ids.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# HTML IDs excluded from the check-html-ids.py check.
library/dis.html: opcode-DELETE_DEREF
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest instead having a 'CPython bytecode changes' section in the what's new, like we had for 3.14, and redirecting to there, but this isn't my area so I'll leave it to the experts.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thanks! Added a "CPython bytecode changes" section to Doc/whatsnew/3.15.rst following the 3.14 pattern. Kept removed-ids.txt as well since it's needed for the CI HTML ID check independently.

9 changes: 9 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,15 @@ Additional optimizations for AArch64 contributed by Mark Shannon and
Diego Russo in :gh:`140683` and :gh:`142305`.)


CPython bytecode changes
========================

* Removed the :opcode:`!DELETE_DEREF` opcode. Deletion of closure variables
is now compiled as :opcode:`LOAD_DEREF`, :opcode:`POP_TOP`,
:opcode:`PUSH_NULL`, :opcode:`STORE_DEREF`.
(Contributed by Aleksandr Tseluyko in :gh:`145858`.)


Removed
========

Expand Down
3 changes: 2 additions & 1 deletion Include/internal/pycore_magic_number.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ Known values:
Python 3.15a4 3661 (Lazy imports IMPORT_NAME opcode changes)
Python 3.15a8 3662 (Add counter to RESUME)
Python 3.15a8 3663 (Merge GET_ITER and GET_YIELD_FROM_ITER. Modify SEND to make it a bit more like FOR_ITER)
Python 3.15a8 3664 (Remove DELETE_DEREF opcode)
Python 3.16 will start with 3700
Expand All @@ -307,7 +308,7 @@ PC/launcher.c must also be updated.
*/

#define PYC_MAGIC_NUMBER 3663
#define PYC_MAGIC_NUMBER 3664
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
(little-endian) and then appending b'\r\n'. */
#define PYC_MAGIC_NUMBER_TOKEN \
Expand Down
10 changes: 2 additions & 8 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading