https://github.com/python/cpython/commit/f7711d55e5fb5f8ada625d16c8cfd05c8d3ea86b
commit: f7711d55e5fb5f8ada625d16c8cfd05c8d3ea86b
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: vstinner <[email protected]>
date: 2026-01-06T16:50:02Z
summary:

[3.13] gh-106318: Add examples for str.isprintable()  (GH-140043) (#143484)

gh-106318: Add examples for str.isprintable()  (GH-140043)
(cherry picked from commit 7b0a372b20ae3b80053d52e84c2b7bdd114c19f0)

Co-authored-by: Adorilson Bezerra <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/stdtypes.rst

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()
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to