gh-106318: Add examples for str.isprintable() (#140043)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
Adorilson Bezerra 2026-01-06 16:43:44 +00:00 committed by GitHub
parent 90c44bc803
commit 7b0a372b20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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