Skip to content

Commit bfe9069

Browse files
committed
Document that string.printable is not POSIX printable.
1 parent eefd4a0 commit bfe9069

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Doc/library/string.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,19 @@ The constants defined in this module are:
5959
String of ASCII characters which are considered punctuation characters
6060
in the ``C`` locale: ``!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``.
6161

62+
6263
.. data:: printable
6364

64-
String of ASCII characters which are considered printable. This is a
65-
combination of :const:`digits`, :const:`ascii_letters`, :const:`punctuation`,
66-
and :const:`whitespace`.
65+
String of ASCII characters which are considered printable by Python.
66+
This is a combination of :const:`digits`, :const:`ascii_letters`,
67+
:const:`punctuation`, and :const:`whitespace`.
68+
69+
.. note::
70+
71+
By design, :meth:`string.printable.isprintable() <str.printable>`
72+
returns :const:`False`. In particular, ``string.printable`` is
73+
neither POSIX printable (see :manpage:`LC_CTYPE <locale(2)>`)
74+
nor printable in the sense of :rfc:`5822`.
6775

6876

6977
.. data:: whitespace

0 commit comments

Comments
 (0)