[Python-ideas] PEP 485: A Function for testing approximate equality

Chris Barker - NOAA Federal chris.barker at noaa.gov
Thu Jan 29 17:12:45 CET 2015


> But I'm fairly sure by now that Guido's right and this should just be
> a recipe.

I think the long thread here is more a reflection that it's an
interesting problem, and frankly, simple enough that almost anyone has
something to say about it.

But the fact that there is no one way to do it that is perfect for all
cases doesn't mean there isn't one way to do it that is useful in the
vast majority of cases.

I'm quite sure that most of the options on the table fit that bill, in fact.

And I'm optimistic that we can converge on an option that most
everyone on this thread can live with.

> I can write my own close_enough function now, with the
> information from this thread.

Sure -- but the idea is that you shouldn't have to. Particularly for
unittest.TestCase or quick command line checks.

-Chris





> The only bit I'd struggle over is what
> tolerance to use, and it doesn't look like anyone has a particularly
> good universal answer for that :-)
>
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list