#14535: Mutability of Graphs
----------------------------+-----------------------------------------------
Reporter: SimonKing | Owner: jason, ncohen, rlm
Type: enhancement | Status: new
Priority: major | Milestone: sage-5.10
Component: graph theory | Keywords: mutability graph
Work issues: | Report Upstream: N/A
Reviewers: | Authors: Simon King
Merged in: | Dependencies: #14524
Stopgaps: |
----------------------------+-----------------------------------------------
This patch allows to create immutable graphs, so that they can be used as
keys in dictionaries.
Previously, calling hash on a graph did work after assigning the attribute
`_immutable` to the graph. That's a hack, and it would in fact ''not''
prevent the graph from being mutated.
With this patch, the attempt to change an immutable graph be means of
methods such as add_vertex or add_edge or delete_vertex, will result in an
error. If one really wants to play nasty, one could make an immutable
graph mutable and change it, or use the backend of the graph for changing
the underlying data.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14535>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.