gh-149402: don't assume single-character type codes (struct/array/ctypes)#149483
gh-149402: don't assume single-character type codes (struct/array/ctypes)#149483skirpichev wants to merge 4 commits intopython:mainfrom
Conversation
…ay/ctypes) In the struct docs, section "Format Characters" was renamed to "Type Codes".
|
RTFD failure seems to be not related to the PR. |
|
"docs/readthedocs.org:cpython-previews" failed with:
Too bad, I like to use it to read rendered documentation :-) |
|
Maybe you can restart it? |
Hum. I wanted to proposing renaming them to "Format Strings", but a "Format String" has already a different meaning in struct, it's the whole string starting with an optional endian character (@, <, >, =, !), followed by format characters with size and alignment. Format Strings: https://docs.python.org/dev/library/struct.html#format-strings. The term "type code" is already used by the array module: the "type codes" table has a "type column", and there is the array.typecodes tuple. It's good to reuse the term. Doc: https://docs.python.org/dev/library/array.html memoryview.cast() first parameter is called "format", and it's a format string (format character with an optional "@" prefix). Doc: https://docs.python.org/dev/library/stdtypes.html#memoryview.cast. cast() error message says "native format". I think that I'm fine with replacing "Format Characters" with "Type Codes" :-) Can you replace "format characters" with "type codes" in Objects/memoryview.c in comments and in the error: PyErr_SetString(PyExc_ValueError,
"memoryview: destination format must be a native single "
"character format prefixed with an optional '@'"); |
I don't see how I can restart a failed RTD job. But it's fine, it will be retried at the next commit anyway. |
the error message looks different for me: I think it's fine. I did replacement for comments, though. |
Documentation build overview
4 files changed± library/array.html± library/binary.html± library/ctypes.html± library/struct.html |
In the struct docs, section "Format Characters" was renamed to "Type Codes".