From 81c121811e6676ebd6e5f24d2363a3d87b2910b4 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Tue, 6 Jan 2026 16:43:44 +0000 Subject: [PATCH] gh-106318: Add examples for str.isprintable() (GH-140043) (cherry picked from commit 7b0a372b20ae3b80053d52e84c2b7bdd114c19f0) Co-authored-by: Adorilson Bezerra Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- Doc/library/stdtypes.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 8f5afea1b6c6dd..9f1bcc9240f0e6 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2052,6 +2052,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() + (False, False) + .. method:: str.isspace()