Docs: Add explanation about little/big endian#109841
Conversation
AA-Turner
left a comment
There was a problem hiding this comment.
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
| 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.
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.
Sorry, this MR drowned in my email inbox. Better now? @AA-Turner
hauntsaninja
left a comment
There was a problem hiding this comment.
Thanks for the PR! It looks like the doctest is failing, maybe add the import?
|
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/