]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106318: Add examples for str.isprintable() (#140043)
authorAdorilson Bezerra <adorilson@gmail.com>
Tue, 6 Jan 2026 16:43:44 +0000 (16:43 +0000)
committerGitHub <noreply@github.com>
Tue, 6 Jan 2026 16:43:44 +0000 (17:43 +0100)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/library/stdtypes.rst

index 7eaa9f48ab5bc4dc9b8c693bec8cdd3936fd65b6..d77d731002019526be4734535ee59b8d4a673e81 100644 (file)
@@ -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()