[Distutils] wordlength etc

Robin Becker robin at jessikat.fsnet.co.uk
Tue Jul 1 00:27:19 EDT 2003


In article <3F009A40.1040303 at lemburg.com>, M.-A. Lemburg
<mal at lemburg.com> writes
>Jeremy Hylton wrote:
>> On Sun, 2003-06-29 at 14:14, M.-A. Lemburg wrote:
>> 
>>>>So we assume struct units are 8 bits and then use calcsize("i")*8 as the
>>>>wordlength.
>>>
>>>sizeofint = len(struct.pack('i',1))
>> 
>> Why not
>> 
>> sizeofint = struct.calcsize("i")
>> 
>> ?
>
>Even better :-)
>
well if I wish to store 4 bits/int then this works

>>> import struct
>>> print struct.calcsize("i")
4

but I assume we can store more than 4 bits per int, so waht tells us we
cans store 8 bits/struct unit?
-- 
Robin Becker



More information about the Distutils-SIG mailing list