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

Tim Peters tim.one at comcast.net
Wed Nov 6 21:54:42 EST 2002


[Jon Ribbens]
>...
> I don't really like the idea of hacking around with the warning
> module, so I guess I'll replace 0x80000000 with (-0x7fffffff-1) which
> won't generate a warning on any version of Python and will work on all
> versions... I think ;-)

You didn't answer the question about what you *intended* 0x80000000 to mean.
The answer to your question follows from that.  If you intended a 1 bit
followed by 31 zero bits, then, no, -0x7fffffff-1 doesn't mean that on some
platforms even today (or even in 1993, for that matter <wink>).





More information about the Python-list mailing list