Skip to content

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

@franklinvp

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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions