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

Brett Cannon brett at python.org
Sun Oct 11 23:16:44 CEST 2009


On Sun, Oct 11, 2009 at 13:00, Glyph Lefkowitz <glyph at twistedmatrix.com>wrote:

> On Sun, Oct 11, 2009 at 3:48 PM, Guido van Rossum <guido at python.org>wrote:
>
>
>> 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.)
>>
>
> This reasoning definitely makes sense to me; with all the
> dependency-migration issues 3.x could definitely use some carrots.  However,
> I don't think I agree with it, because this doesn't feel like a big new
> feature, just some behavior which has changed.  The carrots I'm interested
> in as a user are new possibilties, like new standard library features, a
> better debugger/profiler, or everybody's favorate bugaboo, multicore
> parallelism.  (Although, to be fair, the removal of old-style classes
> qualifies.)
>
>
Sure, but if people like Mark are having to spend their time backporting
every bit of behaviour like this then we won't have the time and energy to
add the bigger carrots to 3.x to help entice people to switch.


> I'd much rather have my doctests and float-repr'ing code break on 2.7 so I
> can deal with it as part of a minor-version upgrade than have it break on
> 3.x and have to deal with this at the same time as the unicode->str
> explosion.  It feels like a backport of this behavior would make the 2->3
> transition itself a little easier.
>

Maybe, but as Mark pointed out, at least in the test suite for Python, there
was no breakage. This will only be an issues if someone does::

  >>> x
  0.029999999

instead of::

  >>> x == 0.03
  True

Plus it should be obvious when a doctest breaks with 0.03 != 0.0299999999999
what has happened.

I'm with Guido: -0 on the backport, especially with Mark feeling neutral on
wanting to put the effort in.

-Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20091011/7fd84f19/attachment.htm>


More information about the Python-Dev mailing list