diff options
author | Stanley <46876382+slateny@users.noreply.github.com> | 2022-10-28 10:21:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-28 10:21:28 (GMT) |
commit | 8cd21c2c5d34a5c5e857782da58d773f29ff8821 (patch) | |
tree | e2eae213460c7bb845a34b8eaa62d8892695dac5 /Doc | |
parent | 25811d9010510d24bbe35acca9da86b064f239c0 (diff) | |
download | cpython-8cd21c2c5d34a5c5e857782da58d773f29ff8821.zip cpython-8cd21c2c5d34a5c5e857782da58d773f29ff8821.tar.gz cpython-8cd21c2c5d34a5c5e857782da58d773f29ff8821.tar.bz2 |
gh-65002: Make note that null bytes are used to pad bytes (#98635)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/struct.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index d12a573..620f503 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'``. |