From 028089d7e74f049a78bfea638c5b069491011e3f Mon Sep 17 00:00:00 2001 From: Jonathan Hilliard Date: Tue, 28 Jan 2020 10:54:04 -0600 Subject: Flagging type-only changes with DiffBuilder --- jsonpatch.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'jsonpatch.py') diff --git a/jsonpatch.py b/jsonpatch.py index 8ec01d3..a72fcea 100644 --- a/jsonpatch.py +++ b/jsonpatch.py @@ -817,10 +817,7 @@ class DiffBuilder(object): self._item_added(path, key, dst[key]) def _compare_values(self, path, key, src, dst): - if src == dst: - return - - elif isinstance(src, MutableMapping) and \ + if isinstance(src, MutableMapping) and \ isinstance(dst, MutableMapping): self._compare_dicts(_path_join(path, key), src, dst) @@ -828,6 +825,9 @@ class DiffBuilder(object): isinstance(dst, MutableSequence): self._compare_lists(_path_join(path, key), src, dst) + elif src == dst and type(src) == type(dst): + return + else: self._item_replaced(path, key, dst) -- cgit v1.2.1