hex/oct constants > sys.maxint will return positive values in Python 2.4 and up

Jon Ribbens jon+usenet at unequivocal.co.uk
Thu Nov 7 14:22:32 EST 2002


In article <j4fzudz0nk.fsf at informatik.hu-berlin.de>, Martin v. Löwis wrote:
>> What platforms doesn't it mean that on? What does it mean on those
>> platforms? Are you talking about platforms with 16-bit integers?
>> If so, I don't care.
> 
> 64-bit platforms. -0x7fffffff-1 is 33 1 bits, followed by 31 zero
> bits, on such systems. In future Python versions, it is an infinite
> number of 1 bits followed by 31 zero bits.

Oh, OK. I don't care about that either because struct.pack("!I") will
still take the least-significant 32 bits and discard the 32-to-infinity
extra set bits.

Sheesh. Metaphors involving "blood" and "stones" come to mind.



More information about the Python-list mailing list