#15278: Hash and equality for graphs
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-5.13
Component: graph theory | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/SimonKing/ticket/15278 | 07bad466ab9a3e2ffe82c142cc6d0c515f1ae452
Dependencies: #12601, #15491 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
A different question: Shall we simply rely on the error that is raised by
the static backend (which is an `AttributeError` when adding or deleting a
vertex and a `NotImplementedError` when adding ), or should we catch the
error and raise a `TypeError` instead, with an error message telling that
this is an immutable graph and adding a vertex is a bad idea in the case
of an immutable graph?
That's to say, would it be enough to have
{{{
sage: G_imm = Graph(graphs.PetersenGraph(),
data_structure="static_sparse")
sage: G_imm.add_vertex(100)
Traceback (most recent call last):
...
AttributeError: 'StaticSparseBackend' object has no attribute
'vertex_ints'
sage: G_imm.delete_vertex(0)
Traceback (most recent call last):
...
AttributeError: 'StaticSparseBackend' object has no attribute
'vertex_ints'
sage: G_imm.add_edge(1,2)
Traceback (most recent call last):
...
NotImplementedError:
}}}
or would we like to have
{{{
sage: G_imm.add_edge(1,2)
Traceback (most recent call last):
...
TypeError: Can not add an edge to an immutable graph
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:30>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.