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.
Created on 2008年12月02日 06:26 by shaddybaddah, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg76726 - (view) | Author: Shaddy Baddah (shaddybaddah) | Date: 2008年12月02日 06:26 | |
I note that using the struct module, a user can specify if number items of the format are to be interpreted as either big or small endian. However the format specifier can only accept one indicator character at its first character to apply for all number items in it. e.g: "<HI" specifies that both the unsigned short and unsigned int are to be interpreted as little endian values. It would be nice to be able to instead do "<>HI" where the first '<' character indicates the default endianess (for compatibility purposes) and then the second '>' character indicates that the unsigned short should be interpreted as big endian. The unsigned int defaults to small endian as per the first character. |
|||
| msg102566 - (view) | Author: Charles-François Natali (neologix) * (Python committer) | Date: 2010年04月07日 20:56 | |
I don't see any reasonale reason for mixing endianess inside a struct, and don't know of any real-life protocol using per-item endianess. Unless someone comes up with a good reason for doing so, and since no one else seems to be interested by this issue, I'd suggest to close it. |
|||
| msg102568 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2010年04月07日 21:39 | |
I agree that this seems like something that would rarely be needed. If it's really necessary, it's possible to break up the format and do the packing/unpacking in fixed-endian pieces. |
|||
| msg102570 - (view) | Author: Raymond Hettinger (rhettinger) * (Python committer) | Date: 2010年04月07日 22:06 | |
FWIW, I concur with Mark and Charles-Francois. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:41 | admin | set | github: 48734 |
| 2010年04月07日 22:06:36 | rhettinger | set | nosy:
+ rhettinger messages: + msg102570 |
| 2010年04月07日 21:39:46 | mark.dickinson | set | status: open -> closed nosy: + mark.dickinson messages: + msg102568 resolution: rejected |
| 2010年04月07日 20:56:48 | neologix | set | nosy:
+ neologix messages: + msg102566 |
| 2008年12月02日 06:26:43 | shaddybaddah | create | |