]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-67206: Document that `string.printable` is not printable in the POSIX sense (...
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 14 Jan 2025 16:07:37 +0000 (17:07 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2025 16:07:37 +0000 (17:07 +0100)
Doc/library/string.rst
Misc/NEWS.d/next/Documentation/2025-01-14-11-06-41.gh-issue-67206.LYKmi5.rst [new file with mode: 0644]

index 913672a3ff22703fbfd4e61c664ba8b970f44d83..09165c481b246ef06ac665b6c372ae137503bd96 100644 (file)
@@ -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 (file)
index 0000000..11fb617
--- /dev/null
@@ -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.