Skip to content

Commit ef89747

Browse files
committed
Merge remote-tracking branch 'upstream/main' into move-magic-number
2 parents 2294fb7 + bc94cf7 commit ef89747

17 files changed

+547
-242
lines changed

Doc/library/sys.monitoring.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ To allow tools to monitor for real exceptions without slowing down generators
226226
and coroutines, the :monitoring-event:`STOP_ITERATION` event is provided.
227227
:monitoring-event:`STOP_ITERATION` can be locally disabled, unlike :monitoring-event:`RAISE`.
228228

229+
Note that the :monitoring-event:`STOP_ITERATION` event and the :monitoring-event:`RAISE`
230+
event for a :exc:`StopIteration` exception are equivalent, and are treated as interchangeable
231+
when generating events. Implementations will favor :monitoring-event:`STOP_ITERATION` for
232+
performance reasons, but may generate a :monitoring-event:`RAISE` event with a :exc:`StopIteration`.
229233

230234
Turning events on and off
231235
-------------------------

Doc/whatsnew/3.14.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ Other Language Changes
8080
command line option. For example, ``python -O -c 'assert await 1'``
8181
now produces a :exc:`SyntaxError`. (Contributed by Jelle Zijlstra in :gh:`121637`.)
8282

83+
* Writes to ``__debug__`` are now detected even if the code is optimized
84+
away by the :option:`-O` command line option. For example,
85+
``python -O -c 'assert (__debug__ := 1)'`` now produces a
86+
:exc:`SyntaxError`. (Contributed by Irit Katriel in :gh:`122245`.)
87+
8388
* Added class methods :meth:`float.from_number` and :meth:`complex.from_number`
8489
to convert a number to :class:`float` or :class:`complex` type correspondingly.
8590
They raise an error if the argument is a string.

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_uop_ids.h

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

Include/internal/pycore_uop_metadata.h

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

Include/opcode_ids.h

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

Lib/_opcode_metadata.py

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

0 commit comments

Comments
 (0)