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

Neil Girdhar mistersheik at gmail.com
Tue Feb 17 00:47:29 CET 2015


Yes, but that asserts if they're not close.  This just returns a bool.

On Mon, Feb 16, 2015 at 5: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>
> ?
>
>
> 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150216/a6043473/attachment.html>


More information about the Python-ideas mailing list