<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jan 27, 2015 at 10:05 AM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jan 27, 2015 at 4:20 PM, Guido van Rossum <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:<br>
> When does a program need *both* absolute and relative tolerance in a single<br>
> test?<br>
<br>
</span>It's reasonably common in numpy, where the equivalent function is<br>
vectorized to do multiple checks at once,</blockquote><div><br></div><div>exactly -- as do a buch of the the unittest assertXXXX methods</div><div><br></div><div>or if folks write their own equivalent in a comprehension.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">if 'math' doesn't provide this then many people will use libraries<br>
that will or else write their own. </blockquote><div><br></div><div>sure -- that's what been done for ages... you could say that about anything new being proposed for the stdlib.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I guess I don't have a good sense<br>
of what the audience for 'math' is these days -- I'm sure it has one,<br>
but aside from tiny one-off usages I'm not sure what it is. None of<br>
the production numerical code I see even bothers importing it.</blockquote><div><br></div><div>Well, I'm a heavy numpy user as well, but I still use the math module when I have something simple to calculate (actually, not so much simple as small -- if I'm not working with a lot of numbers) or if I don't want the numpy dependency.</div><div><br></div><div>A lot of people do at least some math with python -- I have no idea how many. And the statistics package was recently added -- I would have thought that would be next to useless without numpy, but shows you what I know.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> It's<br>
possible that it largely serves a kind of pedagogical role? high<br>
schoolers learning to program etc.?</blockquote><div><br></div><div>anyone learning python may need a bit of math -- there's some pretty basic stuff in there.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The most compelling argument I see is that if we care about unittest,<br>
then it would be good to have a better alternative to<br>
assertAlmostEqual. (...I don't know anyone who uses the unittest API<br>
directly these days, though!)<br></blockquote><div><br></div><div>I agree -- adding it to unitest would be a very good idea.</div><div><br></div><div>-Chris</div><div><br></div><div> <br></div></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>