On Sat, Jan 24, 2015 at 11:59 AM, Chris Barker <chris.barker@noaa.gov> wrote:

I'd much rather require people to have to think about what makes sense for their use case than get trapped by a default that's totally inappropriate.

And by the time you have thought through your use case you're probably better off just writing abs(x-y) <= eps for some eps that you decide from your use case.

The number of messages written to debate this one simple formula make me think it's not so simple after all. So perhaps this is, once again, something that's better off as a recipe?

Alternatively, maybe a useful approach to resolving this debate could be to look for places in actual code where people have solved this for their own use case (as in, written by someone else to solve a real problem, not made up as an example). Then if you see a particular pattern occur repeatedly, you might be able to use that evidence to suggest the right helper function that does the whole thing in one call, and by looking at variations you might get a good insight in the needed parameters and defaults.

--
--Guido van Rossum (python.org/~guido)