[Python-Dev] Backport new float repr to Python 2.7?

Guido van Rossum guido at python.org
Sun Oct 11 21:48:08 CEST 2009

On Sun, Oct 11, 2009 at 11:28 AM, Mark Dickinson <dickinsm at gmail.com> wrote:
> In a recent #python-dev IRC conversation, it was suggested that we
> should consider backporting the new-style float repr from py3k to
> trunk.  I'd like to get people's opinions on this idea.
> Possible problems:
>  - breaking docstrings in third party code.  Though Eric reminded me
>   that when we implemented this for 3.1, there were essentially no
>   standard library test breakages resulting from the changed repr
>   format.

I think you mean doctests? These are the primary reason I've always
been hesitant to change this in 2.x.

>  - some might argue that the new repr (and round) just allows users
>   to remain ignorant of floating-point difficulties for longer, and that
>   this is a bad thing.  I don't really buy either of these points.

If we bought that we wouldn't have fixed in 3.x. :-)

>  - someone has to put in the work.  As mentioned below, I'm happy
>   to do this (and Eric's offered to help, without which this probably
>   wouldn't be feasible at all), but it'll use cycles that I could also
>   usefully be spending elsewhere.
> I'm mostly neutral on the backport idea:  I'm very happy that this is
> in 3.x, but don't see any great need to backport it.  But if there's
> majority (+BDFL) support, I'm willing to put the work in to do the
> backport.

I'm -0 -- mostly because of the 3rd party doctests and perhaps also
because I'd like 3.x to have some carrots. (I've heard from at least
one author who is very happy with 3.x for the next edition of his
"programming for beginners" book.)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list