Skip to content

Commit 65db7e4

Browse files
adorilsonStanFromIreland
authored andcommitted
pythongh-106318: Add examples for str.isprintable() (pythonGH-140043)
(cherry picked from commit 7b0a372) Co-authored-by: Adorilson Bezerra <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 45da8f0 commit 65db7e4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,15 @@ expression support in the :mod:`re` module).
21902190
Nonprintable characters are those in group Separator or Other (Z or C),
21912191
except the ASCII space.
21922192

2193+
For example:
2194+
2195+
.. doctest::
2196+
2197+
>>> ''.isprintable(), ' '.isprintable()
2198+
(True, True)
2199+
>>> '\t'.isprintable(), '\n'.isprintable()
2200+
(False, False)
2201+
21932202

21942203
.. method:: str.isspace()
21952204

0 commit comments

Comments
 (0)