[issue4484] struct: per item endianess specification

Shaddy Baddah report at bugs.python.org
Tue Dec 2 07:26:46 CET 2008


New submission from Shaddy Baddah <shaddy_baddah at hotmail.com>:

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.

----------
components: Library (Lib)
messages: 76726
nosy: da4an1qu1
severity: normal
status: open
title: struct: per item endianess specification
type: feature request
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4484>
_______________________________________


More information about the Python-bugs-list mailing list