<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 2:35 PM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</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">I'm still confused. We're talking about a function that compares two simple values, right? Where does the sequence of values come from?</div></blockquote><div><br></div><div>it comes from wherever, but the idea is that the function itself is called in a loop or comprehension, we could require something like:</div><div><br></div><div>[ is_close_to(i) for i in seq if abs(i) > abs_tol else abs(i) <= abs_tol]</div><div><br></div><div>but I prefer:</div><div><br></div><div>[ is_close_to(i, abs_tolerance=abs_tol) for i in seq ] </div><div><br></div><div>And it gets worse for the TestCase.assert** - those are designed to act on a sequence, so you would need to specify both your relative tolerance and absolute tolerance anyway, if your sequence might have zeros in it.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"> Or perhaps you're talking about assertApproxEqual in test_statistics.py? That has so many ways to specify the relative and absolute tolerance that I give up understanding it. </div></blockquote><div><br></div><div>Something like that, yes, but with a cleaner API and better docs ;-)</div><div><br></div><div>-Chris</div><div><br></div></div><div><br></div>-- <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>