Skip to content

Commit c1a2a16

Browse files
switch edge direction
1 parent 0309af6 commit c1a2a16

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

pytools/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def hash_unhashable(obj: object) -> Union[object, Tuple[int, str]]:
213213
for r in refs:
214214
r = hash_unhashable(r)
215215
if r in res or outside_objects:
216-
res.setdefault(r, []).append(obj)
216+
res.setdefault(obj, []).append(r)
217217

218218
return res
219219

test/test_debug.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def test_get_object_graph():
5959
c = (a, b)
6060
assert get_object_graph([a]) == {(1,): []}
6161
assert get_object_graph([a, b]) == {(1,): [], (2,): []}
62-
assert get_object_graph([a, b, c]) == {((1,), (2,)): [], # c: []
63-
(1,): [((1,), (2,))], # a: [c]
64-
(2,): [((1,), (2,))]} # b: [c]
62+
assert get_object_graph([a, b, c]) == {((1,), (2,)): [(2,), (1,)], # c: [a, b]
63+
(1,): [], # a: []
64+
(2,): []} # b: []
6565

6666
a = {}
6767
b = {"a": a}

0 commit comments

Comments
 (0)