From: Adorilson Bezerra Date: Tue, 6 Jan 2026 16:43:44 +0000 (+0000) Subject: gh-106318: Add examples for str.isprintable() (#140043) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b0a372b20ae3b80053d52e84c2b7bdd114c19f0;p=thirdparty%2FPython%2Fcpython.git gh-106318: Add examples for str.isprintable() (#140043) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 7eaa9f48ab5b..d77d73100201 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2190,6 +2190,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()