cpython/Objects/clinic
Stan Ulbrych 8a598fb623
[3.12] gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130125)
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.

Co-authored-by: Greg Price <gnprice@gmail.com>
(cherry picked from commit 3402e133ef)
2025-02-17 14:07:59 +01:00
..
bytearrayobject.c.h bpo-15999: Accept arbitrary values for boolean parameters. (#15609) 2022-12-03 11:52:21 -08:00
bytesobject.c.h bpo-15999: Accept arbitrary values for boolean parameters. (#15609) 2022-12-03 11:52:21 -08:00
classobject.c.h gh-101409: Improve generated clinic code for self type checks (#101411) 2023-01-31 21:42:03 +01:00
codeobject.c.h [3.12] gh-86457: Fix signature for code.replace() (GH-23199) (#107744) 2023-08-16 14:27:32 +02:00
complexobject.c.h [3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687) (ПР-119805) 2024-05-30 20:52:44 +00:00
descrobject.c.h gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
dictobject.c.h gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code (gh-95860) 2022-08-11 15:25:49 -06:00
enumobject.c.h gh-101409: Improve generated clinic code for self type checks (#101411) 2023-01-31 21:42:03 +01:00
floatobject.c.h [3.12] gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) (GH-122013) 2024-07-19 09:08:33 +00:00
funcobject.c.h gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
listobject.c.h gh-101409: Improve generated clinic code for self type checks (#101411) 2023-01-31 21:42:03 +01:00
longobject.c.h gh-101825: Clarify that as_integer_ratio() output is always normalized (#101843) 2023-02-27 19:11:28 +00:00
memoryobject.c.h gh-102500: Implement PEP 688 (#102521) 2023-05-04 07:59:46 -07:00
moduleobject.c.h gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
odictobject.c.h gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
structseq.c.h gh-90928: Improve static initialization of keywords tuple in AC (#95907) 2022-08-13 12:09:40 +02:00
tupleobject.c.h gh-101409: Improve generated clinic code for self type checks (#101411) 2023-01-31 21:42:03 +01:00
typeobject.c.h gh-96526: Clarify format and __format__ docstrings (gh-96648) 2022-10-03 15:28:02 -07:00
typevarobject.c.h gh-103763: Implement PEP 695 (#103764) 2023-05-15 20:36:23 -07:00
unicodeobject.c.h [3.12] gh-82045: Correct and deduplicate "isprintable" docs; add test. (GH-130125) 2025-02-17 14:07:59 +01:00