#18032: Broken copy, plot in sandpile
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.6
      Component:  graph theory       |   Resolution:
       Keywords:  sd66               |    Merged in:
        Authors:  Peter Wicks        |    Reviewers:  Nathann Cohen
  Stringfield, Volker Braun          |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  c500bfa13492c6c51ea52a5b9c0b91fe7b47806a
  u/vbraun/ticket/18032              |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by vbraun):

 * status:  positive_review => needs_work


Comment:

 I know, but that is fair game in OOP. The standard lore is that you need
 to provide a copy ctor (`__copy__`) if you change the ctor (`__init__`)
 arguments. Then you can always make copies as needed. The ctor makes
 instances (and its arguments may change in subclasses), the copy ctor
 makes identical (as far as possible) copies (and takes the same = no
 arguments all the time).

 Even with this ticket `Sandpile.copy == GenericGraph.__copy__` still
 doesn't work. That is fine with me since it doesn't make a copy anyways.
 But `plot()` also calls `copy(immutable=False)`, so plot is still broken.
 Why can't we plot immutable graphs to start with? Also, copies should be
 mutable, that usually the point of copying the immutable object. See e.g.:
 {{{
 sage: v = vector([1, 2, 3])
 sage: v.is_immutable()
 False
 sage: v.set_immutable()
 sage: v.is_immutable()
 True
 sage: copy(v).is_immutable()
 False
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18032#comment:18>
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/d/optout.

Reply via email to