Message11925

Author jeff.allen
Recipients jeff.allen
Date 2018-04-29.15:05:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525014358.66.0.682650639539.issue2672@psf.upfronthosting.co.za>
In-reply-to
Content
First observed by Helmut Niemann (thanks):

x = int(-(1<<31))
print ('%d' % x) # emits --2147483648

One also observe it as:

>>> int(-(1<<31)).__format__('d')
'--2147483648'

It's important that x be an int, not a long, which is in fact a clue to the work-around. Clearly this is a thinking error somewhere in int.__format__, so we should add a regression test in case it recurs.
History
Date User Action Args
2018-04-29 15:05:58jeff.allensetrecipients: + jeff.allen
2018-04-29 15:05:58jeff.allensetmessageid: <1525014358.66.0.682650639539.issue2672@psf.upfronthosting.co.za>
2018-04-29 15:05:58jeff.allenlinkissue2672 messages
2018-04-29 15:05:57jeff.allencreate