dictdiffer icon indicating copy to clipboard operation
dictdiffer copied to clipboard

diff: allow tolerance only between floats

Open dbrakman opened this issue 1 year ago • 2 comments

Description

For https://github.com/inveniosoftware/dictdiffer/issues/181

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Third-party code

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

dbrakman avatar Mar 30 '24 02:03 dbrakman

Instead of this change, why don't we set the default tolerance to 1e-int_Max?

joesolly avatar Mar 30 '24 04:03 joesolly

There is no int_Max: https://docs.python.org/3/whatsnew/3.0.html#integers

Applying any tolerance for integers would impose a guess as to what magnitudes of numbers people are likely to use or what range of values one's test suite can accept. The tolerance parameter's stated goal of allowing floating point imprecision isn't applicable to integers

dbrakman avatar Apr 01 '24 19:04 dbrakman