[Python-checkins] gh-65002: Make note that null bytes are used to pad bytes (GH-98635)

miss-islington webhook-mailer at python.org
Wed Nov 2 22:24:29 EDT 2022


https://github.com/python/cpython/commit/2199a7dace55cd82b389de02b4fa0120ae353002
commit: 2199a7dace55cd82b389de02b4fa0120ae353002
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-11-02T19:24:24-07:00
summary:

gh-65002: Make note that null bytes are used to pad bytes (GH-98635)

(cherry picked from commit 8cd21c2c5d34a5c5e857782da58d773f29ff8821)

Co-authored-by: Stanley <46876382+slateny at users.noreply.github.com>

files:
M Doc/library/struct.rst

diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index d12a5732fa4a..620f50376beb 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -194,7 +194,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 +291,9 @@ Notes:
    operations. See the Wikipedia page on the `half-precision floating-point
    format <half precision 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'``.



More information about the Python-checkins mailing list