NODE, EDGE, ATTR = range(3) class Node(object): def __init__(self, name, attrs={}): self.name = name self.attrs = attrs def __eq__(self, other): return self.name == other.name and self.attrs == other.attrs class Edge(object): def __init__(self, src, dst, attrs={}): self.src = src self.dst = dst self.attrs = attrs def __eq__(self, other): return (self.src == other.src and self.dst == other.dst and self.attrs == other.attrs) class Graph(object): def __init__(self, data=[]): pass