Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@ The constants defined in this module are:
String of ASCII characters which are considered punctuation characters
in the ``C`` locale: ``!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``.


.. data:: printable

String of ASCII characters which are considered printable. This is a
combination of :const:`digits`, :const:`ascii_letters`, :const:`punctuation`,
and :const:`whitespace`.
String of ASCII characters which are considered printable by Python.
This is a combination of :const:`digits`, :const:`ascii_letters`,
:const:`punctuation`, and :const:`whitespace`.

.. note::

By design, :meth:`string.printable.isprintable() <str.isprintable>`
returns :const:`False`. In particular, ``string.printable`` is
neither POSIX printable (see :manpage:`LC_CTYPE <locale(2)>`)
nor printable in the sense of :rfc:`5822`.


.. data:: whitespace
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Document that :const:`string.printable` is neither printable in the sense of
POSIX nor of :rfc:`5822` In particular, :meth:`string.printable.isprintable()
<str.isprintable>` returns :const:`False`. Patch by Bénédikt Tran.
Loading