#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           |  07bad466ab9a3e2ffe82c142cc6d0c515f1ae452
   Dependencies:  #12601, #15491     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ncohen):

 > A different question: Shall we simply rely on the error that is raised
 by the static backend (which is an `AttributeError` when adding or
 deleting a vertex and a `NotImplementedError` when adding ), or should we
 catch the error and raise a `TypeError` instead, with an error message
 telling that this is an immutable graph and adding a vertex is a bad idea
 in the case of an immutable graph?

 Hmmm.. Well, in the code of `static_sparse_backend` there is an add_vertex
 function which whose code is the following :
 {{{
 raise ValueError("Thou shalt not add a vertex to an immutable graph")
 }}}

 But somehow this is not the exception that appears first when you add a
 vertex from the Python object. Well, I agree with you that having an
 exception saying that "this graph is immutable, and that's probably the
 origin of your problem" would be cool. If would be prettier if those
 exceptions were in the backend, and if these exceptions did appear when
 calling the add_edge/vertex methods from the Python object though `:-)`

 Nathann

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