On 2006-06-15, Tim Peters <[EMAIL PROTECTED]> wrote: > [Grant] >> Am I remebering incorrectly? > > Mostly but not entirely. > >> Didn't the old fixed-width integers operate modulo-wordsize? > > Not in Python. > >> I distinctly remember having to rewrite a bunch of checksum code when >> fixed-width integers went away. > > Best guess is that you're working on a 32-bit box, and remember this > Python <= 2.2 behavior specific to the left shift operator: > >>>> 1 << 31 > -2147483648 >>>> 1 << 32 > 0
That's probably it. I've also spent some time on/off fighting with 32-bit constants that have the high-order bit set. You've got to jump through hoops when you need to pass a value like 0xC0000000 to an extension that demands a 32-bit value. > + - * / on short ints always complained about overflow before > int-long unification, I was definitely mis-remembering things. I had to have been the left shift that caused the problems. -- Grant Edwards grante Yow! I'm CONTROLLED by at the CIA!! EVERYONE is visi.com controlled by the CIA!! -- http://mail.python.org/mailman/listinfo/python-list