Skip to content

Commit fb27187

Browse files
authored
[doc] struct: update note about network byte order form to be more helpful (GH-22201)
Update the sentence to provide some context on why network byte order is defined as big endian.
1 parent 3304cbd commit fb27187

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/struct.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ the :ref:`format-characters` section.
159159
Note the difference between ``'@'`` and ``'='``: both use native byte order, but
160160
the size and alignment of the latter is standardized.
161161

162-
The form ``'!'`` is available for those poor souls who claim they can't remember
163-
whether network byte order is big-endian or little-endian.
162+
The form ``'!'`` represents the network byte order which is always big-endian
163+
as defined in `IETF RFC 1700 <IETF RFC 1700_>`_.
164164

165165
There is no way to indicate non-native byte order (force byte-swapping); use the
166166
appropriate choice of ``'<'`` or ``'>'``.
@@ -467,3 +467,5 @@ The :mod:`struct` module also defines the following type:
467467
.. _half precision format: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
468468

469469
.. _ieee 754 standard: https://en.wikipedia.org/wiki/IEEE_floating_point#IEEE_754-2008
470+
471+
.. _IETF RFC 1700: https://tools.ietf.org/html/rfc1700

0 commit comments

Comments
 (0)