]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-89152: Note truth testing exception in `stdtypes.rst` (GH-137640) (#143081)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Dec 2025 19:42:24 +0000 (20:42 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Dec 2025 19:42:24 +0000 (19:42 +0000)
gh-89152: Note truth testing exception in `stdtypes.rst` (GH-137640)
(cherry picked from commit 3c0888b25b4c1dc1dee6d0edf05d51d3cc24486e)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/stdtypes.rst

index 0036b198330ff6c1d731dba2332d826f2db228ef..883d7a4ecd40f3273039a6e0c41bb5ef2e8dc917 100644 (file)
@@ -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)