Skip to content

Commit e25083a

Browse files
miss-islingtonStanFromIrelandZeroIntensityJelleZijlstra
authored
[3.14] gh-89152: Note truth testing exception in stdtypes.rst (GH-137640) (#143081)
gh-89152: Note truth testing exception in `stdtypes.rst` (GH-137640) (cherry picked from commit 3c0888b) 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>
1 parent 33c9ebe commit e25083a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/stdtypes.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ Any object can be tested for truth value, for use in an :keyword:`if` or
4646
By default, an object is considered true unless its class defines either a
4747
:meth:`~object.__bool__` method that returns ``False`` or a
4848
:meth:`~object.__len__` method that
49-
returns zero, when called with the object. [1]_ Here are most of the built-in
50-
objects considered false:
49+
returns zero, when called with the object. [1]_ If one of the methods raises an
50+
exception when called, the exception is propagated and the object does
51+
not have a truth value (for example, :data:`NotImplemented`).
52+
Here are most of the built-in objects considered false:
5153

5254
.. index::
5355
single: None (Built-in object)

0 commit comments

Comments
 (0)