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

 Hellooooooooo !!

 > The usage is `if getattr(self,'_immutable',False/True): raise
 TypeError("...")` (false or true depending on whether we want to allow
 something for all graphs except those that are known to be mutable, or
 allow something for all graphs except those that are known to be
 immutable).
 >
 > I've never heard before that Python uses it.

 Oh. Then I guess we are the only ones to use this `._immutable` flag.

 > On the other hand (thinking after writing, as usual...): The optional
 arguments of `__copy__` are not used, but when one defines `copy=__copy__`
 then the method and its documentation do appear in the docs and can be
 used by people. Hm. In the end, it might be better to keep it.
 >
 > But one question on copying needs to be addressed: I think in some
 places in Sage, `copy(X)` returns `X` if `X` is immutable, but in other
 places in Sage, `copy(X)` always returns a ''mutable'' copy of `X`,
 regardless whether `X` is mutable or not. What would you prefer for
 graphs?
 >
 > In any case, I should add a test showing what happens with copies of
 immutable graphs.

 Hmmm... Well, I guess it makes more sense to get with "copy" the same kind
 of object that was given as input. So copying an immutable graph would
 just return the same object. Unless copy is called with an argument
 specifying a different implementation of course `O_o`

 > Do I understand correctly: You say I shouldn't try to add the "nicer"
 syntax now, since you would take care of it in a review patch/other
 ticket?

 Well, if you feel like doing in this ticket I will gladly review it here.
 Otherwise I feel that it would be better to let this ticket be set to
 positive review so that you can use it for whatever you have in mind, and
 I will write this kind of improvements that are useless to you but would
 make my life easier `:-)`

 Nathann

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