diff options
author | Jonathan Hilliard <jonathan.hilliard@hpe.com> | 2020-01-28 10:54:04 -0600 |
---|---|---|
committer | Jonathan Hilliard <jonathan.hilliard@hpe.com> | 2020-01-28 10:54:04 -0600 |
commit | 028089d7e74f049a78bfea638c5b069491011e3f (patch) | |
tree | 895596d038a95d1862882f97adcda1c829ee2515 | |
parent | ed43114953c231e3feec715c87fa6c17b37cbdf9 (diff) | |
download | python-json-patch-028089d7e74f049a78bfea638c5b069491011e3f.tar.gz |
Flagging type-only changes with DiffBuilder
-rw-r--r-- | jsonpatch.py | 8 |
1 files changed, 4 insertions, 4 deletions
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) |