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

Chris Angelico rosuav at gmail.com
Fri Jan 23 19:00:01 CET 2015


On Sat, Jan 24, 2015 at 4:55 AM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Fri, Jan 23, 2015 at 9:45 AM, Chris Angelico <rosuav at gmail.com> wrote:
>>
>> > And the unitest is very vested in
>> > it's OO structure -- would we want add free-form functions to it?
>>
>> Updating the assertion to use the new function would be a matter of
>> tweaking the implementation of unittest's assertAlmostEqual() to now
>> call this function and assert that it returns True.
>
> sure -- that's not quite what I meant. I was really addressing the "where
> would this sit" question.
>
> unittest does not currently have any stand-alone utility functions for
> testing in it. If we put this there, would anyone think to look for it
> there?

I agree, this function doesn't belong in unittest. If it's in, say,
math, then unittest can call on it from there.

ChrisA


More information about the Python-ideas mailing list