https://github.com/python/cpython/commit/3c0888b25b4c1dc1dee6d0edf05d51d3cc24486e commit: 3c0888b25b4c1dc1dee6d0edf05d51d3cc24486e branch: main author: Stan Ulbrych <[email protected]> committer: JelleZijlstra <[email protected]> date: 2025-12-22T11:36:44-08:00 summary:
gh-89152: Note truth testing exception in `stdtypes.rst` (#137640) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> files: M Doc/library/stdtypes.rst diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index f33b73238ec8b3..7eaa9f48ab5bc4 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) _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
