[Python-ideas] PEP 485: A Function for testing approximate equality
Chris Barker
chris.barker at noaa.gov
Tue Feb 17 06:11:11 CET 2015
On Sun, Feb 15, 2015 at 2:07 PM, Neil Girdhar <mistersheik at gmail.com> wrote:
> I'm +1 on the idea, +1 on the name, but -1 on symmetry.
>
> I'm glad that you included "other approaches" (what people actually do in
> the field). However, your argument that "is it that hard to just type it
> in" — the whole point of this method is to give a self-commenting line that
> describes what the reader means.
>
yes. sure.
> Doesn't it make sense to say: is *my value* close to *some true value*?
> If you wanted a symmetric test in english, you might say "are these values
> close to each other"?
>
exactly -- it also makes sense to ask "are these values close to each
other" The problem is that you can't have one function that does both
(without flags or optional parameters. After a lengthy discussion, I
decided that the later was a bit more useful and less surprising.
And do read carefully -- if your tolerance is small -- it doesn't matter at
all.
-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/20150216/fa3ec256/attachment-0001.html>
More information about the Python-ideas
mailing list