<div dir="ltr">On Fri, Jan 23, 2015 at 6:41 PM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Jan 24, 2015 at 1:35 PM, Andrew Barnert<br>
<abarnert@yahoo.com.dmarc.invalid> wrote:<br>
> Maybe the answer there is to have an is_close_to_0 function, instead of a parameter that's only useful if expected is 0? But then you might have, say, a comprehension where some of the expected values are 0 and some aren't, so maybe not...<br>
><br>
<br>
</span>That's a more philosophical question about API design. It's probably<br>
worth mentioning the two options in the PEP - separate function for<br>
"close to zero" with these args, or put it all into the one function<br>
with those args.<br></blockquote><div><br></div><div>I could mention it -- though I started all this thinking that we should keep relative and absolute tolerance separate, then realized that relative was going to be useless for zero, so added the absolute tolerance to cover that (which I originally named zero_tol, but realized that it really was absolute everywhere...). Now that we're thinking that we can have a switch for the exactly zero case, then there may be no need to have an absoute tolerance parameter, but only relative and zero.<br><br></div><div>Then you'd have a separate function (if you wanted) for absolute tolerance, so it could have a default -- that may be better than requiring the user to set the parameter to get an absolute tolerance test at all.<br><br>I guess the key question is if someone would want both an relative tolerance and an absolute tolerance, aside from the zero issue.<br><br></div><div>-Chris<br><br></div><div><br><br></div><div><br><br></div><div><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ChrisA<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>