[issue1742669] "%d" format handling for long values

2008-06-11 Thread Pádraig Brady
Pádraig Brady <[EMAIL PROTECTED]> added the comment: A couple of comments. 1. This bug supersedes issue 1153226 That has good info, including the suggestion that one should be using the %.f format rather than %d in this case anyway 2. The patch here was actually applied in r61041 -- no

[issue1742669] "%d" format handling for long values

2008-02-23 Thread Facundo Batista
Facundo Batista added the comment: Applied in r61040. Thanks you all! -- resolution: -> accepted status: open -> closed _ Tracker <[EMAIL PROTECTED]> _

[issue1742669] "%d" format handling for long values

2008-02-22 Thread Facundo Batista
Facundo Batista added the comment: Paul, %d will accept large floats, I need to review Gabriel's patch; your proposition will break too much code. _ Tracker <[EMAIL PROTECTED]> _ ___

[issue1742669] "%d" format handling for long values

2008-02-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I am of the opposite side: %d should accept floats and anything that can be converted to an integer. It is for printing objects with a decimal format. (likewise %s is for printing objects that can be converted to a string) -- nosy: +amaury.forgeotd

[issue1742669] "%d" format handling for long values

2008-02-21 Thread paul rubin
paul rubin added the comment: I would prefer that %d signal an error 100% of the time if you give it a float. It should not accept 42.0. It is for printing integers. -- nosy: +phr _ Tracker <[EMAIL PROTECTED]> _

[issue1742669] "%d" format handling for long values

2008-02-18 Thread Gabriel Genellina
Gabriel Genellina added the comment: An updated patch, along the lines given by Travis Oliphant. Added file: http://bugs.python.org/file9458/floatfmt.diff _ Tracker <[EMAIL PROTECTED]>

[issue1742669] "%d" format handling for long values

2008-01-24 Thread Facundo Batista
Facundo Batista added the comment: Closed issue 1924 as duplicate of this one, but I'm copying here the text from David, as it's very explanative: """ I ran across this bug in some legacy production code when numbers got high: >>> '%i' % 2e9 '20' >>> '%i' % 3e9 Traceback (most recent ca

[issue1742669] "%d" format handling for long values

2007-11-07 Thread Gabriel Genellina
Gabriel Genellina added the comment: Yes, I can reformulate it. In fact my original version was quite different, but the resulting diff was hard to understand so I rewrote it trying to keep as much as the original code as possible. I'll submit a new patch next weekend.

[issue1742669] "%d" format handling for long values

2007-11-06 Thread Facundo Batista
Facundo Batista added the comment: I'm positive that this shouldn't happen. There should NOT be any difference between longs and ints in nowadays Python, so you never should say to an user to call that long() before the %d. And, you have some strange behaviours... for example: >>> "%d" % 9e8 '9

[issue1742669] "%d" format handling for long values

2007-11-01 Thread Travis Oliphant
Travis Oliphant added the comment: I have two issues with this patch: 1) I'm not sure it's that bad to need to use '%d' % long(obj) to ensure conversion to a long integer. 2) If this kind of auto-conversion is deemed useful, then the patch itself is rather complicated. I would re-factor so th