mgedmin/objgraph

incorrect labes for dict keys

Opened this issue · 1 comments

import objgraph

objgraph.show_refs({"a": None, "b": None}, filename="bad.png")

output:

bad

actual:

digraph ObjectGraph {
  node[shape=box, style=filled, fillcolor=white];
  o140231118682496[fontcolor=red];
  o140231118682496[label="dict\n2 items"];
  o140231118682496[fillcolor="0,0,1"];
  o140231118682496 -> o9447968 [label="a",weight=2];
  o140231118682496 -> o9447968 [label="a",weight=2];
  o9447968[label="NoneType\nNone"];
  o9447968[fillcolor="0,0,0.766667"];
}

expected diff:

--- bad.dot     2020-08-17 22:47:05.690718600 +0100
+++ good.dot    2020-08-17 22:48:15.922067400 +0100
@@ -4,7 +4,7 @@
   o140231118682496[label="dict\n2 items"];
   o140231118682496[fillcolor="0,0,1"];
   o140231118682496 -> o9447968 [label="a",weight=2];
-  o140231118682496 -> o9447968 [label="a",weight=2];
+  o140231118682496 -> o9447968 [label="b",weight=2];
   o9447968[label="NoneType\nNone"];
   o9447968[fillcolor="0,0,0.766667"];
 }