Edges are reported not to be instances of graph-tool's Edge class
Today, I came across the following bug: edges returned from graph_tool.Graph.add_edge()
or graph_tool.Graph.edge()
fail test for isintance
against graph-tool's Edge
. See the snippet below:
>>> import graph_tool.all as gt
>>> g = gt.Graph()
>>> v1 = g.add_vertex()
>>> v2 = g.add_vertex()
>>> e_1 = g.add_edge(v1,v2)
>>> e_2 = g.edge(s=v1,t=v2)
>>> type(v1)
<class 'graph_tool.libgraph_tool_core.Vertex'>
>>> type(v2)
<class 'graph_tool.libgraph_tool_core.Vertex'>
>>> type(e_1)
<class 'graph_tool.libgraph_tool_core.Edge'>
>>> type(e_2)
<class 'graph_tool.libgraph_tool_core.Edge'>
>>> isinstance(v1, gt.Vertex)
True
>>> isinstance(v2, gt.Vertex)
True
>>> isinstance(e_1, gt.Edge)
False
>>> isinstance(e_2, gt.Edge)
False
>>> import graph_tool
>>> isinstance(e_1, graph_tool.libgraph_tool_core.Edge)
False
>>> isinstance(e_2, graph_tool.libgraph_tool_core.Edge)
False