Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 10 additions & 3 deletions Doc/library/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ 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 not
printable in the POSIX sense (see :manpage:`LC_CTYPE <locale(5)>`).


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