hex(-5) => Futurewarning: ugh, can't we have a better hex than '-'[:n<0]+hex(abs(n)) ??

Michael Peuser mpeuser at web.de
Sun Aug 17 23:47:31 CEST 2003

"Bengt Richter" <bokr at oz.net> schrieb im Newsbeitrag
news:bhomem$jg8$0 at
> >>> hex(-5)
> __main__:1: FutureWarning: hex()/oct() of negative int will return a
signed string in Python 2.4 and up  '0xfffffffb'


There is a thread from this morning ("bitwise not ...") - this should be an
excellent contribution!
I have no mercy with someone writing hex(-5)

Michael P

More information about the Python-list mailing list