Skip to content

Bug: jsondiff accepts list items as equal when their __eq__ returns True #180

Description

@franklinvp

DiffBuilder._compare_lists goes over the given MutableSequence and considers the items as equal (skips them) when old == new.
This has the same problem that the comment contained in DiffBuilder._compare_values, above the line elif self.dumps(src) == self.dumps(dst):, that says that they are comparing strings to avoid false positives that src == dst would have.

For example, comparing

data1.json

{
   "field": [1, 1]
}

and

data2.json

{
    "field": [1, True]
}

results in no difference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions