#15278: Hash and equality for graphs
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: needs_review
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 | 2fc8a772ee12fce7ac6abc4ecf9916f4746f5ee2
Dependencies: #12601, #15491 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by ncohen):
HMmmmm... Don't you touch cachefunc.pyx in commit
126b03609e9bae78955ccbc97e36f1924a79603b ? That's when you merge #12601 in
the present branch.
Gosh, I'm going to hate these git dependencies.
Some remarks, though :
- In `.copy()`, you add a line before everything else to handle your case.
Couldn't you add a line after the second "if" block, the one after which
we know for sure that `data_structure` has been defined, saying "if
data_structure == "static_sparse" and hasattr(self,'_immutable')" then
return self ? By the way, is an object considered mutable if it HAS a
._immutable variable equal to False ?
- Why wouldn't we add (later) a "immutable" flag to the constructor and to
"copy" ? It would be nice to call
`Graph(graphs.PetersenGraph(),immutable=True)` ? `O_o`
- What about an exception message for `_hash_` that would give the hint
that hashable graphs can be built ? Something like "This graph is mutable,
and thus not hashable. To make it mutable, read the doc of Graph.copy."
I personnally don't mind much, it's more for your crowd... They may
think that it can't be done and leave.
Oh. And it's cool, the multiple edges problem and loops are handled by the
backend too. Well, thus making graphs immutable looks rather shorter than
I first thought `:-)`
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:39>
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.