[issue1716] String format operator '%i' fails for large floats

Guido van Rossum report at bugs.python.org
Tue Jan 1 04:02:58 CET 2008


Guido van Rossum added the comment:

On the one hand, if you want to format a float like that, you should use
"%.0f".  On the other hand, this should either consistently fail or
succeed, not depending on how large the float is.

I think in 2.6 we can't change this, but in 3.0, I propose that all
these accept only integers.  I find the behavior of %x and %o with
floats particularly anti-intuitive.

On the third hand, we're expecting % to be phased out in favor of
.format(), which allows floats of any value with the i, d, o, x format
specifiers.  So perhaps we should leave this alone?

----------
nosy: +gvanrossum
priority:  -> low

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1716>
__________________________________


More information about the Python-bugs-list mailing list