Message11925
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. |
|
Date |
User |
Action |
Args |
2018-04-29 15:05:58 | jeff.allen | set | recipients:
+ jeff.allen |
2018-04-29 15:05:58 | jeff.allen | set | messageid: <1525014358.66.0.682650639539.issue2672@psf.upfronthosting.co.za> |
2018-04-29 15:05:58 | jeff.allen | link | issue2672 messages |
2018-04-29 15:05:57 | jeff.allen | create | |
|