If I do this in Sagemath10.0:
G = Graph()
G.add_vertex('a')
G.add_vertex(1)
print(G.vertices())
I get a deprecation warning but also this error: File ~/sage/sage-10.0/src/sage/graphs/generic_graph.py:11370, in GenericGraph.vertices(self, sort, key, degree, vertex_property) 11367 raise ValueError('sort keyword is False, yet a key function is given') 11369 if sort:
11370 return sorted(self.vertex_iterator(degree=degree, vertex_property=vertex_property), key=key) 11371 return list(self.vertex_iterator(degree=degree, vertex_property=vertex_property))
TypeError: '<' not supported between instances of 'int' and 'str'
According to the documentation, the name of a vertex should be immutable, so an integer and a string should be fine. Is it a bug or am I doing something wrong?