[Python-Dev] floatformat vs float_format

David Cournapeau cournape at gmail.com
Thu Jan 1 07:11:11 CET 2009


In python 2.6, there have been some effort to make float formatting
more consistent between platforms, which is nice. Unfortunately, there
is still one corner case, for example on windows:

print a -> print 'inf'
print '%f' % a -> print '1.#INF'

The difference being that in the second case, the formatting is done
in floatformat.c (in stringobject.c), whereas in the first case, it is
done in format_float (in floatobject.c). Shouldn't both functions be
calling the same underlying implementation, to avoid those
inconsistencies ?



More information about the Python-Dev mailing list