clear_edges() and clear() do not reset the number of edges.
Bug reports:
clear_edges() and clear() do not reset the number of edges.
I tested with an environment below.
OS: macOS Sierra 10.12.5
Python version: 2.7.13
graph-tool version: 2.22_2
An example code producing the problem is below:
from graph_tool.all import *
# Case 1
g = Graph(directed=True)
e = g.add_edge(0, 1)
g.clear_edges()
print(g.num_edges()) # 1
g.remove_edge(e)
print(g.num_edges()) # 1
g.clear()
print(g.num_edges()) # 1
# Case 2
g = Graph(directed=True)
e = g.add_edge(0, 1)
g.remove_edge(e)
print(g.num_edges()) # 0
g.clear_edges()
print(g.num_edges()) # 0