hex and unsigned longs

Igor V. Rafienko igorr at ifi.uio.no
Sat Apr 12 10:22:50 EDT 2003


Hi,

The documentation for the built-in function hex() says that hex()
always returns an unsigned literal. However, on my 2.2.1 python, I get
the following results:

>>> hex( 1 )
'0x1'
>>> hex( 1L )
'0x1L'
>>> hex( -1 )
'0xffffffff'
>>> hex( -1L )
'-0x1L'
>>> 

The literal in the last case is obviously not unsigned. What am I
missing? (I.e. why are longs treated differently than ints by hex?)

TIA,





ivr
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?




More information about the Python-list mailing list