Skip to content

Commit a114ed2

Browse files
authored
Merge pull request #480 from artemisart/patch-1
Fix _dict_from_slots, solves Path comparison
2 parents 47d7816 + ce1c8fb commit a114ed2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ Authors in order of the timeline of their contributions:
6363
- [sf-tcalhoun](https://github.com/sf-tcalhoun) for fixing "Instantiating a Delta with a flat_dict_list unexpectedly mutates the flat_dict_list"
6464
- [dtorres-sf](https://github.com/dtorres-sf) for fixing iterable moved items when iterable_compare_func is used.
6565
- [Florian Finkernagel](https://github.com/TyberiusPrime) for pandas and polars support.
66+
- Mathis Chenuet [artemisart](https://github.com/artemisart) for fixing slots classes comparison.

deepdiff/diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def unmangle(attribute):
421421
else:
422422
all_slots.extend(slots)
423423

424-
return {i: getattr(object, unmangle(i)) for i in all_slots}
424+
return {i: getattr(object, key) for i in all_slots if hasattr(object, key := unmangle(i))}
425425

426426
def _diff_enum(self, level, parents_ids=frozenset(), local_tree=None):
427427
t1 = detailed__dict__(level.t1, include_keys=ENUM_INCLUDE_KEYS)

tests/test_diff_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ def __str__(self):
17131713
t2 = Bad()
17141714

17151715
ddiff = DeepDiff(t1, t2)
1716-
result = {'unprocessed': ['root: Bad Object and Bad Object']}
1716+
result = {}
17171717
assert result == ddiff
17181718

17191719
def test_dict_none_item_removed(self):

0 commit comments

Comments
 (0)