#15278: Hash and equality for graphs
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: defect | Status: needs_info
Priority: major | Milestone: sage-6.1
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):
Yoooooooooooo !!
> > HMmmmm... Don't you touch cachefunc.pyx in commit
126b03609e9bae78955ccbc97e36f1924a79603b ? That's when you merge #12601 in
the present branch.
>
> Splitting hair...
Ahahah. Well, not really.. In a merge commit you have sometimes to settle
conflicts manually, adding any amount of code you like, and this code
needs to be reviewed too. And I have absolutely no understanding of this
part of the code `:-P`
And for some reason I thought when I made this comment that it was the
case, though I can't find it back again `O_o`
Well, well...
> I am working on it.
Cool !
> Hmm. Would this be possible? I think a graph should be considered
immutable if and only if the static backend is used---or rather if and
only if ''some'' static backend is used: Perhaps there will be more static
backends in future.
>
> So, instead of relying on an attribute `._immutable` that the user could
mess with, one could test for the type of the backend when we need to know
whether a graph is immutable.
>
> Problem: If I am not mistaken, people currently ''do'' mess with the
attribute `._immutable`, if I am not mistaken.
Yes yes indeed, that's what Nicolas told me they did at the moment, and
that's what Python uses too know whether it should consider the object as
mutable or not. I just wondered if it checked whether the variable
existed, or whether the variable was set to True too.
> Would it be feasible to try to remove the `._immutable` attribute (and
testing the type of the backend instead), see how much fails, and fix the
failing code by using "proper" immutable graphs?
Hmmmm, I thought that Python really needed this `_immutable` variable
somewhere `O_o`
> Would a flag in the "copy" function be supported by Python?
Well not in `.__copy__` but in `.copy()` no problem I guess.
>
> > It would be nice to call
`Graph(graphs.PetersenGraph(),immutable=True)` ? `O_o`
> Yes. Only problem: We would then need to decide what to do if
"immutable=False" and "backend="static_sparse" is simultaneously used.
I usually settle this by setting the keywords to "None" by default,
instead of True/False. Then if the user manually sets two keywords to
contradicting values, either ignore one of the two or scream, as usual.
I'll do that in another patch when this one will be reviewed, it will be
an easier syntax.
Nathann
--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:47>
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.