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

Martin v. Löwis loewis at informatik.hu-berlin.de
Thu Nov 7 04:04:45 EST 2002


Jon Ribbens <jon+usenet at unequivocal.co.uk> writes:

> 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 ;-)

I would still recommend to use 0x8000000L instead; it saves you one
computation, and is more readable.

Regards,
Martin



More information about the Python-list mailing list