Thanks for a fast response. If I may ask, what is it good for to encode 'id' in 16 bytes and 'di' in 12? Rob On 01/24/2018 12:00 PM, Christian Heimes wrote: > Christian Heimes <lists@cheimes.de> added the comment: > > It's not a bug. Please read the section about padding. > >>>> struct.calcsize('id') > 16 >>>> struct.calcsize('>id') > 12 > > ---------- > nosy: +christian.heimes > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker <report@bugs.python.org> > <https://bugs.python.org/issue32648> > _______________________________________
Hardware restrictions, some CPUs require types to be aligned in certain ways. Doubles must be aligned by multiple of 8 bytes. Please read https://en.wikipedia.org/wiki/Data_structure_alignment and use the Python users mailing list for further questions.
History
Date
User
Action
Args
2022-04-11 14:58:57
admin
set
github: 76829
2018-01-24 13🔞46
christian.heimes
set
messages: +
2018-01-24 13:04:15
Róbert Lexmann
set
messages: +
2018-01-24 11:00:51
christian.heimes
set
status: open -> closednosy: + christian.heimesmessages: + resolution: not a bugstage: resolved