From 3c0888b25b4c1dc1dee6d0edf05d51d3cc24486e Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 22 Dec 2025 19:36:44 +0000 Subject: [PATCH 1/2] gh-89152: Note truth testing exception in `stdtypes.rst` (#137640) Co-authored-by: Peter Bierma Co-authored-by: Jelle Zijlstra --- Doc/library/stdtypes.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f33b73238ec..7eaa9f48ab5 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -46,8 +46,10 @@ Any object can be tested for truth value, for use in an :keyword:`if` or By default, an object is considered true unless its class defines either a :meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object.__len__` method that -returns zero, when called with the object. [1]_ Here are most of the built-in -objects considered false: +returns zero, when called with the object. [1]_ If one of the methods raises an +exception when called, the exception is propagated and the object does +not have a truth value (for example, :data:`NotImplemented`). +Here are most of the built-in objects considered false: .. index:: single: None (Built-in object) From 665d2807a09df2bce3452ce2ee36e85299e863b7 Mon Sep 17 00:00:00 2001 From: Ken Jin Date: Tue, 23 Dec 2025 04:54:47 +0800 Subject: [PATCH 2/2] gh-139109: Add terminator to JIT code when halting due to invalid dependencies (#143033) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add terminator to JIT code when halting due to invalid dependencies * 📜🤖 Added by blurb_it. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> --- .../2025-12-21-00-25-26.gh-issue-139109.gwSsOL.rst | 1 + Python/optimizer.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2025-12-21-00-25-26.gh-issue-139109.gwSsOL.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-12-21-00-25-26.gh-issue-139109.gwSsOL.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-21-00-25-26.gh-issue-139109.gwSsOL.rst new file mode 100644 index 00000000000..17cceac4e09 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-12-21-00-25-26.gh-issue-139109.gwSsOL.rst @@ -0,0 +1 @@ +Add missing terminator in certain cases when tracing in the new JIT compiler. diff --git a/Python/optimizer.c b/Python/optimizer.c index 6e7f599fbe9..869889bf259 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -710,7 +710,7 @@ _PyJit_translate_single_bytecode_to_trace( } if (!_tstate->jit_tracer_state.prev_state.dependencies_still_valid) { - goto done; + goto full; } // This happens when a recursive call happens that we can't trace. Such as Python -> C -> Python calls