From 2583485457a62d881697bc3016b63b5cf6ef8af6 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Wed, 26 Oct 2022 08:31:51 -0700 Subject: [PATCH 1/2] Add padding note to footnote of Format Characters --- Doc/library/struct.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index d12a5732fa4a0d..72b0642c06573b 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -61,7 +61,6 @@ The module defines the following exception and functions: write the packed bytes into the writable buffer *buffer* starting at position *offset*. Note that *offset* is a required argument. - .. function:: unpack(format, buffer) Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``) @@ -194,7 +193,7 @@ platform-dependent. +--------+--------------------------+--------------------+----------------+------------+ | Format | C Type | Python type | Standard size | Notes | +========+==========================+====================+================+============+ -| ``x`` | pad byte | no value | | | +| ``x`` | pad byte | no value | | \(7) | +--------+--------------------------+--------------------+----------------+------------+ | ``c`` | :c:expr:`char` | bytes of length 1 | 1 | | +--------+--------------------------+--------------------+----------------+------------+ @@ -291,6 +290,9 @@ Notes: operations. See the Wikipedia page on the `half-precision floating-point format `_ for more information. +(7) + For padding, ``x`` inserts null bytes. + A format character may be preceded by an integral repeat count. For example, the format string ``'4h'`` means exactly the same as ``'hhhh'``. From eab6aabd849c313b1facce8c98dc6fcf702affb3 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Wed, 26 Oct 2022 08:33:05 -0700 Subject: [PATCH 2/2] Readd newline --- Doc/library/struct.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index 72b0642c06573b..620f50376beb62 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -61,6 +61,7 @@ The module defines the following exception and functions: write the packed bytes into the writable buffer *buffer* starting at position *offset*. Note that *offset* is a required argument. + .. function:: unpack(format, buffer) Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``)