From 4c676cf9b1da7782638aed197caf6d1bcaff9013 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 11 Aug 2025 11:54:49 +0200 Subject: [PATCH 1/7] Commit --- Doc/library/stdtypes.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a81a6704142dcc..6c02520c4df129 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -38,7 +38,8 @@ Truth Value Testing pair: Boolean; operations single: false -Any object can be tested for truth value, for use in an :keyword:`if` or +Any object can be tested for truth value (with the exception of the +:exc:`NotImplemented` object), for use in an :keyword:`if` or :keyword:`while` condition or as operand of the Boolean operations below. .. index:: single: true From eaec3427c2840e20cf7416fcead6061613b33ee3 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 11 Aug 2025 19:12:55 +0200 Subject: [PATCH 2/7] Changes --- Doc/library/stdtypes.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 6c02520c4df129..12f810bd2a611e 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -38,8 +38,7 @@ Truth Value Testing pair: Boolean; operations single: false -Any object can be tested for truth value (with the exception of the -:exc:`NotImplemented` object), for use in an :keyword:`if` or +Any object can be tested for truth value, for use in an :keyword:`if` or :keyword:`while` condition or as operand of the Boolean operations below. .. index:: single: true @@ -47,7 +46,9 @@ Any object can be tested for truth value (with the exception of the 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 +returns zero, when called with the object. [1]_ If one of the methods raises an +exception when they are called, the exception is propagated and the object does +not have a truth value. Here are most of the built-in objects considered false: .. index:: From 072f6aeb40187660075c579a7556b3438a343d0e Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 11 Aug 2025 19:24:24 +0200 Subject: [PATCH 3/7] Add example --- Doc/library/stdtypes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 12f810bd2a611e..6c3eea81ac2c2d 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -48,8 +48,8 @@ By default, an object is considered true unless its class defines either a :meth:`~object.__len__` method that returns zero, when called with the object. [1]_ If one of the methods raises an exception when they are called, the exception is propagated and the object does -not have a truth value. Here are most of the built-in -objects considered false: +not have a truth value (for example, :exc:`NotImplemented`). +Here are most of the built-in objects considered false: .. index:: single: None (Built-in object) From 9735baf7a812213b2f0b18b36c2fee7e3403fbeb Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 11 Aug 2025 19:30:25 +0200 Subject: [PATCH 4/7] Grammar fixup Co-authored-by: Peter Bierma --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 6c3eea81ac2c2d..c21a90f4979657 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -46,7 +46,7 @@ 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]_ If one of the methods raises an +returns zero, when called with the object. [1]_ If one of the methods raise an exception when they are called, the exception is propagated and the object does not have a truth value (for example, :exc:`NotImplemented`). Here are most of the built-in objects considered false: From c1a4d90168e2bc4aa193862df80260aabefef0f3 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 11 Aug 2025 22:08:31 +0200 Subject: [PATCH 5/7] Correct role --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index c21a90f4979657..dbcd170a9ee106 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -48,7 +48,7 @@ By default, an object is considered true unless its class defines either a :meth:`~object.__len__` method that returns zero, when called with the object. [1]_ If one of the methods raise an exception when they are called, the exception is propagated and the object does -not have a truth value (for example, :exc:`NotImplemented`). +not have a truth value (for example, :data:`NotImplemented`). Here are most of the built-in objects considered false: .. index:: From 730e0c52fedd8fb90952407f7da41c21f36bb6dc Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 12 Aug 2025 07:30:53 +0200 Subject: [PATCH 6/7] Update Doc/library/stdtypes.rst Co-authored-by: Jelle Zijlstra --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index dbcd170a9ee106..210140a6974ed4 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -46,7 +46,7 @@ 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]_ If one of the methods raise an +returns zero, when called with the object. [1]_ If one of the methods raises an exception when they are 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: From 1881218ca9df3e60fedbec97a3a0c31ab5fbea5a Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Tue, 12 Aug 2025 16:10:27 +0200 Subject: [PATCH 7/7] Update stdtypes.rst Co-authored-by: Jelle Zijlstra --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 210140a6974ed4..3cfbad95431ffb 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -47,7 +47,7 @@ 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]_ If one of the methods raises an -exception when they are called, the exception is propagated and the object does +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: