From 1f977f409f1764829b2fdff27e5d25ce060a6e5f Mon Sep 17 00:00:00 2001 From: Yzi-Li <1538321957@qq.com> Date: Sat, 3 May 2025 11:09:46 +0800 Subject: [PATCH 1/5] standardize boolean constants in stdtypes.rst --- 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 39aaa5da0786f8..f05c17e82f056e 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2012,7 +2012,7 @@ expression support in the :mod:`re` module). .. method:: str.isprintable() - Return true if all characters in the string are printable, false if it + Return ``True`` if all characters in the string are printable, ``False`` if it contains at least one non-printable character. Here "printable" means the character is suitable for :func:`repr` to use in From de2ddeabac1f09155b3bfe4fa397004b9e9c5281 Mon Sep 17 00:00:00 2001 From: Yzi-Li <1538321957@qq.com> Date: Sat, 3 May 2025 12:19:31 +0800 Subject: [PATCH 2/5] standardize true in str.swapcase() --- 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 f05c17e82f056e..930169b519ce9a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2371,7 +2371,7 @@ expression support in the :mod:`re` module). .. method:: str.swapcase() Return a copy of the string with uppercase characters converted to lowercase and - vice versa. Note that it is not necessarily true that + vice versa. Note that it is not necessarily ``True`` that ``s.swapcase().swapcase() == s``. From 25796322beec135c446ae780cf5c69db0c4ef95a Mon Sep 17 00:00:00 2001 From: Yzi-Li <1538321957@qq.com> Date: Sat, 3 May 2025 17:46:50 +0800 Subject: [PATCH 3/5] Revert "standardize true in str.swapcase()" This reverts commit de2ddeabac1f09155b3bfe4fa397004b9e9c5281. --- 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 930169b519ce9a..f05c17e82f056e 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2371,7 +2371,7 @@ expression support in the :mod:`re` module). .. method:: str.swapcase() Return a copy of the string with uppercase characters converted to lowercase and - vice versa. Note that it is not necessarily ``True`` that + vice versa. Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. From c1902c34be93ac741892a1534436659c2f005ca2 Mon Sep 17 00:00:00 2001 From: Yzi-Li <1538321957@qq.com> Date: Fri, 9 May 2025 18:44:24 +0800 Subject: [PATCH 4/5] fix up in logging.rst and string.rst --- Doc/library/logging.rst | 2 +- Doc/library/string.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 72190e97240514..378d0e29dd1715 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -828,7 +828,7 @@ empty string, all events are passed. .. method:: filter(record) - Is the specified record to be logged? Returns false for no, true for + Is the specified record to be logged? Returns ``False`` for no, ``True`` for yes. Filters can either modify log records in-place or return a completely different record instance which will replace the original log record in any future processing of the event. diff --git a/Doc/library/string.rst b/Doc/library/string.rst index b44d98819b6998..845c13e4934f41 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -237,7 +237,7 @@ See also the :ref:`formatspec` section. The *field_name* itself begins with an *arg_name* that is either a number or a keyword. If it's a number, it refers to a positional argument, and if it's a keyword, it refers to a named keyword argument. An *arg_name* is treated as a number if -a call to :meth:`str.isdecimal` on the string would return true. +a call to :meth:`str.isdecimal` on the string would return ``True``. If the numerical arg_names in a format string are 0, 1, 2, ... in sequence, they can all be omitted (not just some) and the numbers 0, 1, 2, ... will be automatically inserted in that order. @@ -858,7 +858,7 @@ these rules. The methods of :class:`Template` are: .. method:: is_valid() - Returns false if the template has invalid placeholders that will cause + Returns ``False`` if the template has invalid placeholders that will cause :meth:`substitute` to raise :exc:`ValueError`. .. versionadded:: 3.11 From 58f180a546ad60154a9d09df76f480d42d6ec93c Mon Sep 17 00:00:00 2001 From: Yzi-Li <1538321957@qq.com> Date: Fri, 9 May 2025 21:46:26 +0800 Subject: [PATCH 5/5] update string.rst and logging.rst --- Doc/library/logging.rst | 2 +- Doc/library/string.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index 378d0e29dd1715..72190e97240514 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -828,7 +828,7 @@ empty string, all events are passed. .. method:: filter(record) - Is the specified record to be logged? Returns ``False`` for no, ``True`` for + Is the specified record to be logged? Returns false for no, true for yes. Filters can either modify log records in-place or return a completely different record instance which will replace the original log record in any future processing of the event. diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 845c13e4934f41..c4012483a52f73 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -237,7 +237,7 @@ See also the :ref:`formatspec` section. The *field_name* itself begins with an *arg_name* that is either a number or a keyword. If it's a number, it refers to a positional argument, and if it's a keyword, it refers to a named keyword argument. An *arg_name* is treated as a number if -a call to :meth:`str.isdecimal` on the string would return ``True``. +a call to :meth:`str.isdecimal` on the string would return true. If the numerical arg_names in a format string are 0, 1, 2, ... in sequence, they can all be omitted (not just some) and the numbers 0, 1, 2, ... will be automatically inserted in that order.