Skip to content

Commit 7b0a372

Browse files
pythongh-106318: Add examples for str.isprintable() (python#140043)
Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 90c44bc commit 7b0a372

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)