https://github.com/python/cpython/commit/85255c4df2c7758de45f4c972f749f05c5c95127
commit: 85255c4df2c7758de45f4c972f749f05c5c95127
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: picnixz <[email protected]>
date: 2025-01-15T14:28:21Z
summary:

[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 d906bde250d59c396d8dab92285b832c66cdec27)

Co-authored-by: Bénédikt Tran <[email protected]>

files:
A Misc/NEWS.d/next/Documentation/2025-01-14-11-06-41.gh-issue-67206.LYKmi5.rst
M Doc/library/string.rst

diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 913672a3ff2270..09165c481b246e 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -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
diff --git 
a/Misc/NEWS.d/next/Documentation/2025-01-14-11-06-41.gh-issue-67206.LYKmi5.rst 
b/Misc/NEWS.d/next/Documentation/2025-01-14-11-06-41.gh-issue-67206.LYKmi5.rst
new file mode 100644
index 00000000000000..11fb617e98edc3
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Documentation/2025-01-14-11-06-41.gh-issue-67206.LYKmi5.rst
@@ -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.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to