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

Chris Barker chris.barker at noaa.gov
Tue Jan 27 07:35:01 CET 2015


On Mon, Jan 26, 2015 at 9:30 PM, Chris Angelico <rosuav at gmail.com> wrote:

> I would suggest that, as PEP author, you guide the conversation a bit
> by asking specific questions that you want to answer in the PEP.
>

I thought I did that, actually, in that email -- I guess I wasn't very
clear.

Here they are -- and please express not just your preference, but a clear
statement about what would be acceptable or not acceptable.

A) Which test do we use:
  1) The asymmetric test
  2) The "strong" test (minimum relative tolerance)
  3) The "weak" test (maximum relative tolerance)

B) Do we provide a non-zero default for the absolute tolerance? If so what
should the value be? Remember that this serves primarily to provide a check
against zero.

I think that's it for the technical decisions.

I would also appreciate suggestions for paramater names --at least if we go
with the asymetric test: "actual" and "expected" is a bit confusing -- I
like "expected", but we need something better than "actual" for the
don't-know-it's-right one.

I also would really appreciate someone working out the details and
contributing text for the inclusion of this in unittest.TestCase --
unittest is really not my thing.

I've pushed some changes to gitHub (sorry, forgot to push yesterday), and
once the dust settles I'll incorporate as many of the suggestions in the
PEP text as I can.

-Chris




-- 

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/20150126/449ddf51/attachment-0001.html>


More information about the Python-ideas mailing list