Dealing with hex

Matt Gerrans mgerrans at mindspring.com
Tue Dec 9 22:49:16 EST 2003


Is there an ideal approach to dealing with the FutureWarning about getting
the hex value of a negative int?    I'm using zlib.crc32() which can return
a negative 32-bit int value, so for example print '%x' % zlib.crc32(
buffer ) generates the FutureWarning.    I know I could jump through hoops
to coerce the int into a long that will have the same CRC, but is there some
particular recomendation for this (I looked at PEP 237, but there wasn't a
suggestion).






More information about the Python-list mailing list