Skip to content

Commit

Permalink
pythongh-65002: Make note that null bytes are used to pad bytes (pyth…
Browse files Browse the repository at this point in the history
…onGH-98635)

(cherry picked from commit 8cd21c2)

Co-authored-by: Stanley <[email protected]>
  • Loading branch information
slateny authored and miss-islington committed Oct 28, 2022
1 parent 725efe4 commit cd99d7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Doc/library/struct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |
+--------+--------------------------+--------------------+----------------+------------+
Expand Down Expand Up @@ -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'``.
Expand Down

0 comments on commit cd99d7d

Please sign in to comment.