Disagree with proposed 2.4 behavior for %x formatting of signed i nts

Letbetter, Jason letbetter at ti.com
Mon Sep 8 16:40:00 EDT 2003


Consider the following:

>>> print "0x%08X" % -1041053949
__main__:1: FutureWarning: %u/%o/%x/%X of negative int will return a signed
string in Python 2.4 and up
0xC1F2C703

If I understand the warning correctly then the following would happen after
2.4:

>>> print "0x%08X" % -1041053949
-1041053949

I think the printf format should take precedence.  It is obvious that the
programmer wants a hex number displayed.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20030908/4cd6297d/attachment.html>


More information about the Python-list mailing list