On Mon, Oct 12, 2009 at 11:41 AM, Mark Dickinson <dicki...@gmail.com> wrote:
> [Guido]
>> PS. str(x) still seems to be using %.12g -- shouldn't it be made equal
>> to repr() in 3.1 or 3.2? *That* I would call a bug, an oversight.
>
> But str still has some value in py3k:  it protects users from
> accumulated rounded errors produced by arithmetic operations:
[...]

I know, but this is much more questionable now. Making str() and
repr() different was an intentional choice when repr() would often
show ugly values even if the input was pretty; but now str() just
hides real differences (1.3 != 1.2 + 1.1), and the difference between
str() and repr() is pretty subtle. (Show of hands for those who didn't
even know there was a difference? :-). I think if we had to start from
scratch with the 3.1 float repr() I would have made float's str()
equal to its repr(). But this is at most a +1 feeling.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to