cpython/Objects/clinic
Stan Ulbrych 3402e133ef
gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130118)
We had the definition of what makes a character "printable" documented in three places, giving two different definitions.
The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that.

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.

Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place.

Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs.

Also add a thorough test that the implementation agrees with this definition.

Author:    Greg Price <gnprice@gmail.com>

Co-authored-by: Greg Price <gnprice@gmail.com>
2025-02-14 18:16:47 +01:00
..
bytearrayobject.c.h gh-129559: Add bytearray.resize() (GH-129560) 2025-02-05 11:33:17 -08:00
bytesobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
classobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
codeobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
complexobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
descrobject.c.h gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
dictobject.c.h gh-112075: Remove critical section in dict.get (gh-129336) 2025-01-28 21:55:45 +00:00
enumobject.c.h gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
exceptions.c.h gh-128421: make exception group methods thread safe (#129298) 2025-01-25 23:50:09 +05:30
floatobject.c.h gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
funcobject.c.h gh-128714: Fix function object races in __annotate__, __annotations__ and __type_params__ in free-threading build (#129016) 2025-02-06 20:10:50 +05:30
listobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
longobject.c.h gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
memoryobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
moduleobject.c.h gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
odictobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
setobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
structseq.c.h gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564) 2024-11-08 14:23:50 +02:00
tupleobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
typeobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
typevarobject.c.h gh-111178: Generate correct signature for most self converters (#128447) 2025-01-20 12:40:18 +01:00
unicodeobject.c.h gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130118) 2025-02-14 18:16:47 +01:00