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.

Author mrolle
Recipients Alan.Ning, Brian Trotter, amaury.forgeotdarc, belopolsky, mrolle, rgaddi
Date 2016-11-09.03:43:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478662999.0.0.596292252422.issue20629@psf.upfronthosting.co.za>
In-reply-to
Content
As a separate issue, I'd like to find an appropriate package,
other than ctypes, for interpreting data bytes in a consistently
defined manner, independent of the platform I'm running on.
The struct package is perfect where there are no bitfields
involved, i.e., where each item occupies whole bytes.  But
it doesn't support packing/unpacking bitfields.

Actually, ctypes could fit the bill if you specified that bitfields
be allocated from MSB to LSB for BigEndianStructure, and from LSB
to MSB for LittleEndianStructure.  This way, for instance, it wouldn't matter if a sequence of 4-bit fields were based on c_ubyte
or c_ushort, etc.  Each pair of fields would be allocated to the
next consecutive byte.  And if the platform native compiler for some strange reason doesn't follow either of these rules, then Structure
would follow the platform compiler.

differs from both Big and Little
History
Date User Action Args
2016-11-09 03:43:19mrollesetrecipients: + mrolle, amaury.forgeotdarc, belopolsky, Alan.Ning, rgaddi, Brian Trotter
2016-11-09 03:43:19mrollesetmessageid: <1478662999.0.0.596292252422.issue20629@psf.upfronthosting.co.za>
2016-11-09 03:43:18mrollelinkissue20629 messages
2016-11-09 03:43:18mrollecreate