-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Docs: Add explanation about little/big endian #109841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could maybe write the byte pairs as Python byte strings. But that has cons. Also consider extracting this note into an admonition like tip
or hint
or info
.
A
Doc/library/struct.rst
Outdated
The number ``1023``, or ``0x3ff`` in hex, is represented as follows in bytes: | ||
|
||
* ``0x03 0xff`` in big-endian (``>``) | ||
* ``0xff 0x03`` in little-endian (``<``) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could make this a .. tip
or hint?
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this MR drowned in my email inbox. Better now? @AA-Turner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It looks like the doctest is failing, maybe add the import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI is good now.
Thanks @Granjow for the PR, and @hauntsaninja for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
(cherry picked from commit 177b9cb) Co-authored-by: Simon A. Eugster <simon.eu@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
GH-115646 is a backport of this pull request to the 3.12 branch. |
(cherry picked from commit 177b9cb) Co-authored-by: Simon A. Eugster <simon.eu@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
GH-115647 is a backport of this pull request to the 3.11 branch. |
…5646) Docs: Add explanation about little/big endian (GH-109841) (cherry picked from commit 177b9cb) Co-authored-by: Simon A. Eugster <simon.eu@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
…5647) Docs: Add explanation about little/big endian (GH-109841) (cherry picked from commit 177b9cb) Co-authored-by: Simon A. Eugster <simon.eu@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Wow, that went fast now, thanks a lot! |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Aims to help users like me which always have to look up which way round endianness now works.
📚 Documentation preview 📚: https://cpython-previews--109841.org.readthedocs.build/