[Python-Dev] Round Bug in Python 1.6?
Greg Ward
gward@mems-exchange.org
Fri, 7 Apr 2000 08:49:15 -0400
On 06 April 2000, Guido van Rossum said:
> This is because repr() now uses full precision for floating point
> numbers. round() does what it can, but 3.1416 just can't be
> represented exactly, and "%.17g" gives 3.1415999999999999.
>
> This is definitely the right thing to do for repr() -- ask Tim.
>
> However, it may be time to switch so that "immediate expression"
> values are printed as str() instead of as repr()...
+1 on this: it's easier to change "foo" to "`foo`" than to "str(foo)" or
"print foo". It just makes more sense to use str().
Oh, joy! oh happiness! someday soon, I may be able to type
"blah.__doc__" at the interactive prompt and get a readable result!
Greg