#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           |  c774057bf07b2da8539f2395555b2062428874f4
   Dependencies:  #12601             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by SimonKing):

 I have uploaded a preliminary "patch" (or branch, actually). The existing
 tests pass.

 What it already does:
 - If a graph is immutable then the `__copy__` method returns the graph---
 unless of course optional arguments are passed to the `__copy__` method.
 This is standard behaviour for immutable things, IIRC.
 - If `.weighted(...)` is used to modify an immutable graph, then an error
 is raised.
 - The `__hash__` became a cached method

 So far, I am not setting the `._immutable` flag for the immutable graph
 backend. I did not add tests for the new code. And I did not verify that
 all "official" methods will be unable to alter an immutable graph (so far,
 I only fixed `.weighted()`). This shall be done in the next commits.

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