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

Chris Barker chris.barker at noaa.gov
Tue Feb 17 06:01:41 CET 2015


On Mon, Feb 16, 2015 at 2:57 PM, Ryan Gonzalez <rymg19 at gmail.com> wrote:

> Doesn't Python already have this with unittest.TestCase.assertAlmostEqual
> <https://docs.python.org/3.4/library/unittest.html#unittest.TestCase.assertAlmostEqual>
> ?
>

Please read the PEP -- assertAlmostEQual is an absolute tolerance test --
not a relative tolerance.

-Chris



>
> On Sat, Feb 14, 2015 at 7:26 AM, Victor Stinner <victor.stinner at gmail.com>
> wrote:
>
>> Hi,
>>
>> Do you propose a builtin function? I would prefer to put it in the math
>> module.
>>
>> You may add a new method to unittest.TestCase? It would show all
>> parameters on error. .assertTrue(isclose(...)) doesn't help on error.
>>
>> Victor
>>
>> _______________________________________________
>> 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/
>>
>
>
>
> --
> Ryan
> If anybody ever asks me why I prefer C++ to C, my answer will be simple:
> "It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
> nul-terminated."
> Personal reality distortion fields are immune to contradictory evidence. -
> srean
> Check out my website: http://kirbyfan64.github.io/
>



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150216/eb0bf017/attachment.html>


More information about the Python-ideas mailing list