(old_dict, new_dict, with_unchanged)
| 40 | |
| 41 | |
| 42 | def _diff_dicts(old_dict, new_dict, with_unchanged): |
| 43 | new = _flatten(new_dict) |
| 44 | old = _flatten(old_dict) |
| 45 | |
| 46 | res: dict[str, dict] = defaultdict(dict) |
| 47 | |
| 48 | xpaths = set(old.keys()) |
| 49 | xpaths.update(set(new.keys())) |
| 50 | for xpath in xpaths: |
| 51 | old_val = old[xpath] |
| 52 | new_val = new[xpath] |
| 53 | val_diff = _diff_vals(old_val, new_val, with_unchanged) |
| 54 | if val_diff: |
| 55 | res[xpath] = val_diff |
| 56 | return dict(res) |
| 57 | |
| 58 | |
| 59 | def _diff(old_raw, new_raw, with_unchanged): |