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

Skip Montanaro skip at pobox.com
Mon Sep 8 16:49:50 EDT 2003


    Jason> 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

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

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

I think you misunderstand.  It will be signed, but still presented as hex.
Try googling for "futurewarning negative int" for a number of discussions on
the subject.

Skip





More information about the Python-list mailing list