This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Correct and deduplicate docs on "printable" characters
Type: Stage: patch review
Components: Unicode Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Greg Price, ezio.melotti, vstinner
Priority: normal Keywords: patch

Created on 2019-08-15 04:40 by Greg Price, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 15300 open Greg Price, 2019-08-15 04:43
Messages (1)
msg349792 - (view) Author: Greg Price (Greg Price) * Date: 2019-08-15 04:40
While working on #36502 and then #18236 about the definition and docs of str.isspace(), I looked closely also at its neighbor str.isprintable().

It turned out that we have the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` is inverted, so that's an easy small fix.
With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database.  That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics.

I've taken a crack at writing some improved docs text for a single definition, borrowing ideas from the C comment as well as the existing docs text; and then pointing there from the other places we'd had definitions. PR coming shortly.
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82045
2019-08-15 04:43:18Greg Pricesetkeywords: + patch
stage: patch review
pull_requests: + pull_request15025
2019-08-15 04:40:26Greg Pricecreate