Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6414] struct module : processor endianness descriptions misleading

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 4, 2009, 12:46 AM

Post #1 of 6 (435 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading

New submission from Karl Magdsick <kmagdsick [at] hotmail>:

In http://docs.python.org/dev/library/struct.html,

it says
"Native byte order is big-endian or little-endian, depending on the host
system. For example, Motorola and Sun processors are big-endian; Intel
and DEC processors are little-endian."

This is a gross over-generalization at best. Off the top of my head,
current Linux kernels run the Intel Itanium in big-endian mode. (Though,
I don't recall if there's a non-privileged instruction to flip
endianness, system headers and system calls are defined in big-endian
order, which is what's most relevant to the struct module.) Sun SPARC
v9 is bi-endian. Intel Itanium and XScale processors are bi-endian. Dec
Alphas are bi-endian. (Though, I'm only aware of Cray using Alphas in
big-endian mode.)

The quoted paragraph should name specific processors which are single-
endian (Intel Core 2, Sun SPARC v8) and/or provide a Wikipedia
reference, rather than making incorrect statements.

Intel Itanium machines running Linux are probably the most common
systems where this statement's inaccuracy is likely to cause confusion
among developers.

----------
assignee: georg.brandl
components: Documentation
messages: 90107
nosy: georg.brandl, kmag
severity: normal
status: open
title: struct module : processor endianness descriptions misleading
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 7, 2009, 2:52 AM

Post #2 of 6 (389 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

Something like "Motorola and Sun processors are usually big-endian;
Intel and DEC processors are usually little-endian" (or "most
of"/"several") might be enough.

----------
keywords: +easy
nosy: +ezio.melotti
priority: -> low

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 7, 2009, 4:56 AM

Post #3 of 6 (384 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

Maybe it's better to avoid the platform-specific statements altogether,
and just point out the existence of sys.byteorder for those who want to
check the endianness of the system they're currently working on.

Or maybe just mention that the x86 and AMD64 (aka x86-64) architectures
are little-endian; I'd guess that this covers a good proportion of the
processors that people are currently running Python on. People using more
exotic architectures probably already know their endianness.

----------
nosy: +marketdickinson

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 5:21 AM

Post #4 of 6 (382 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading [In reply to]

Alexey Shamrin <shamrin [at] gmail> added the comment:

Good suggestions, Mark! We should do both, I think. I didn't know about
sys.byteorder before your message ;-) Thanks for education!

How about this:

"Native byte order is big-endian or little-endian, depending on the host
system. For example, Intel x86 and AMD64 (x86-64) are little-endian;
Motorola 68000 and PowerPC G5 are big-endian; some are even bi-endian
(switchable endianess) - ARM and DEC Alpha. Use sys.byteorder to check
the endianess of your system."

Sorry for any spelling and styling mistakes...

----------
nosy: +ash

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 5:24 AM

Post #5 of 6 (378 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading [In reply to]

Alexey Shamrin <shamrin [at] gmail> added the comment:

Little style:

"Native byte order is big-endian or little-endian, depending on the host
system. For example, Intel x86 and AMD64 (x86-64) are little-endian;
Motorola 68000 and PowerPC G5 are big-endian; ARM and DEC Alpha feature
switchable endianness (bi-endian). Use sys.byteorder to check the
endianess of your system."

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 9, 2009, 8:50 AM

Post #6 of 6 (376 views)
Permalink
[issue6414] struct module : processor endianness descriptions misleading [In reply to]

Changes by Raymond Hettinger <rhettinger [at] users>:


----------
assignee: georg.brandl -> rhettinger
nosy: +rhettinger
versions: +Python 3.2 -Python 2.5, Python 3.0

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6414>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.