[Python-ideas] PEP 485: A Function for testing approximate equality

Zero Piraeus schesis at gmail.com
Sat Jan 31 18:17:32 CET 2015


On Tue, Jan 27, 2015 at 10:31:01PM -0800, Chris Barker wrote:
> On Tue, Jan 27, 2015 at 4:38 PM, Zero Piraeus <schesis at gmail.com> wrote:
> > Note that my example was an any_close() function, not an all_close()
> > one. I doubt anyone's seriously going to suggest adding *three* new
> > functions, so anyone who wants something like that will by necessity
> > end up rolling their own.
> OK -- that is pretty compelling --- I have been looking for use-cases
> for where having a symmetrical test would be a clear advantage, and
> this is one.
> But this is where I'm unclear -- is this "any_close" function
> something you think is a real use case -- i.e. you have needed such a
> thing, or think there is a strong chance that you will. Or just
> something that _could_ be done.

I have needed an any_close() function in the past, but used absolute
tolerances, so it's not particularly relevant to the discussion (except
maybe that if is_close() existed, I might have used it just because it
was there without really thinking things through).

> Granted, I think your point is that if it _could_ be done, there is a
> good chance that _someone_ will do it -- and with that in mind we want
> as few surprising behaviors in the standard lib as possible.



Zero Piraeus: pons asinorum

More information about the Python-ideas mailing list