<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 26, 2015 at 10:35 PM, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">On Mon, Jan 26, 2015 at 9:30 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would suggest that, as PEP author, you guide the conversation a bit<br>
by asking specific questions that you want to answer in the PEP.<br></blockquote><div><br></div></span><div>I thought I did that, actually, in that email -- I guess I wasn't very clear.<br><br></div><div>Here they are -- and please express not just your preference, but a clear statement about what would be acceptable or not acceptable.<br><br></div><div>A) Which test do we use:<br></div><div>  1) The asymmetric test<br></div><div>  2) The "strong" test (minimum relative tolerance)<br></div><div>  3) The "weak" test (maximum relative tolerance)<br clear="all"></div></div></div></div></blockquote><div><br></div><div>The problem with this question is that, while it's easy to come up with examples where it may matter (e.g. 95 is within 5% of 100, but 100 is not within %5 of 95), in practice the tolerance is more likely to be 1e-8, in which case it doesn't matter.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div><div class="gmail_extra">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.<br></div></div></blockquote><div><br></div><div>It feels like absolute tolerance is a completely different test. And it is a much simpler test for which w don't need a helper function -- it's just abs(x) < tolerance.<br><br></div><div>When does a program need *both* absolute and relative tolerance in a single test?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra">I think that's it for the technical decisions.<br><br></div>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.<br><br><div><div class="gmail_extra"><br>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.<br><br></div><div class="gmail_extra">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.<br></div></div></div></blockquote><div><br></div><div>I still think this is better off as a recipe than as a helper function.<br> <br></div></div>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)</div>
</div></div>