#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):

 Helloooooooo !!

 > Ahem. Then I guess there are many things in Python that I've never heard
 of...

 Ahahahah. That's how sure we both are of our Python knowledge `:-PPP`

 > From my perspective, this behaviour would be fine. But I also see this:
 > {{{
 > sage: M = matrix([[1,2,3],[4,5,6]])
 > sage: M.set_immutable()
 > sage: M.is_immutable()
 > True
 > sage: m = copy(M)
 > sage: m.is_immutable()
 > False
 > }}}
 > There is one crucial difference, though: A mutable matrix can be made
 immutable, by `M.set_immutable()`. But a mutable graph can (currently?)
 not easily be made immutable, since mutability crucially relies on the
 backend, which is not the case for matrices.

 Yepyep. Making it mutable needs to copy it, so it has to go through .copy
 or through the constructor.

 > Anyway, I don't think that there is a commonly accepted standard in
 Sage. Since we have no `G.set_immutable()` method for graphs, I guess it
 is better to have
 > - `copy(G)` has the same backend as G. In particular, mutability is
 copied. And if it is immutable, then we should have `G is copy(G)`.
 > - If one wants an immutable/mutable copy of a mutable/immutable graph G,
 then it should be done either by `Graph(G,backend='...')` or
 `G.copy(backend='...')` respectively with a to-be-implemented
 `mutable=True/False` keyword.

 Yepyep, works for me `:-)`

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/15278#comment:53>
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.

Reply via email to