]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-89152: Note truth testing exception in `stdtypes.rst` (#137640)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Mon, 22 Dec 2025 19:36:44 +0000 (19:36 +0000)
committerGitHub <noreply@github.com>
Mon, 22 Dec 2025 19:36:44 +0000 (11:36 -0800)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/stdtypes.rst

index f33b73238ec8b33d533845d5952b83c747b327d5..7eaa9f48ab5bc4dc9b8c693bec8cdd3936fd65b6 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)