10000 [3.12] gh-67206: Document that `string.printable` is not printable in… · python/cpython@85255c4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85255c4

Browse files
[3.12] gh-67206: Document that string.printable is not printable in the POSIX sense (GH-128820) (#128867)
gh-67206: Document that `string.printable` is not printable in the POSIX sense (GH-128820) (cherry picked from commit d906bde) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 5675e06 commit 85255c4

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Doc/library/string.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,18 @@ 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+
9B68 .. note::
70+
71+
By design, :meth:`string.printable.isprintable() <str.isprintable>`
72+
returns :const:`False`. In particular, ``string.printable`` is not
73+
printable in the POSIX sense (see :manpage:`LC_CTYPE <locale(5)>`).
6774

6875

6976
.. data:: whitespace
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Document that :const:`string.printable` is not printable in the POSIX sense.
2+
In particular, :meth:`string.printable.isprintable() <str.isprintable>` returns
3+
:const:`False`. Patch by Bénédikt Tran.

0 commit comments

Comments
 (0)
0