From 44804240db5e108ae13750215122ea34b0bac2ed Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sun, 21 Mar 2021 22:55:05 -0300 Subject: [PATCH 1/3] [Doc] Added snippet code to str.isprintable method --- Doc/library/stdtypes.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 21fe35edc1bef8..6b738f89974b33 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2123,6 +2123,8 @@ expression support in the :mod:`re` module). value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric. +.. _meth-str-isprintable: + .. method:: str.isprintable() Return ``True`` if all characters in the string are printable, ``False`` if it @@ -2139,6 +2141,15 @@ expression support in the :mod:`re` module). Nonprintable characters are those in group Separator or Other (Z or C), except the ASCII space. + For example: + + .. doctest:: + + >>> ''.isprintable(), ' '.isprintable() + (True, True) + >>> '\t'.isprintable(), '\n'.isprintable() # TAB and BREAK LINE + (False, False) + .. method:: str.isspace() From 03c226b05640cd3cc268b3ca63d8c493136f30ca Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Mon, 13 Oct 2025 12:27:10 -0300 Subject: [PATCH 2/3] [Doc] Remove unnecessary role on str.isprintable() --- Doc/library/stdtypes.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 6b738f89974b33..7f2ac051926940 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2123,8 +2123,6 @@ expression support in the :mod:`re` module). value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric. -.. _meth-str-isprintable: - .. method:: str.isprintable() Return ``True`` if all characters in the string are printable, ``False`` if it From 8d6f369757043d5bfe80b921b43d7e9af7afce02 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Fri, 19 Dec 2025 15:12:26 +0000 Subject: [PATCH 3/3] gh-106318: Update Doc/library/stdtypes.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- 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 7f2ac051926940..03e1ce9b9dc77c 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2145,7 +2145,7 @@ expression support in the :mod:`re` module). >>> ''.isprintable(), ' '.isprintable() (True, True) - >>> '\t'.isprintable(), '\n'.isprintable() # TAB and BREAK LINE + >>> '\t'.isprintable(), '\n'.isprintable() (False, False)