This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: struct's docstring implies alignment is always performed
Type: behavior Stage:
Components: Documentation Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Eli_B, docs@python
Priority: normal Keywords:

Created on 2018-02-15 16:52 by Eli_B, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg312214 - (view) Author: Eli_B (Eli_B) * Date: 2018-02-15 16:52
In module struct's docstring, it says:
"...
The optional first format char indicates byte order, size and alignment:\n
  @: native order, size & alignment (default)\n
  =: native order, std. size & alignment\n
  <: little-endian, std. size & alignment\n
  >: big-endian, std. size & alignment\n
  !: same as >\n
..."
The wording sounds like either native or standard alignment is performed, regardless of the optional first format char.

In comparison, the table in https://docs.python.org/3.8/library/struct.html#byte-order-size-and-alignment states that in all modes other than the default, no alignment is performed. This is the actual behavior of the module.
History
Date User Action Args
2022-04-11 14:58:57adminsetgithub: 77034
2018-02-15 16:52:04Eli_Bcreate