#18032: Broken copy, plot in sandpile
-------------------------------------+-------------------------------------
       Reporter:  vbraun             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  graph theory       |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/peterwicksstringfield/ticket/18032|  
595a889044e8910542c992f1d6783cb03500fdac
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ncohen):

 * status:  new => needs_review


Comment:

 Hello,

 There are several problems with your code:

 - Why do you add this new `_make_copy` method in `GenericGraph`? I am not
 sure
   that I understand your goal, but I suspect that you may want to learn
 about
   the 'super' function of Python:

   http://stackoverflow.com/questions/576169/understanding-python-super-
 with-init-methods

   Perhaps you only want to call `super().__copy__()` somewhere?

 - The way you added `*args` and `**kwds` to the `__init__` method of
 !Sandpile,
   the constructor now accepts anything as input,
   e.g. `Sandpile(heyheyhey="heyheyhey")` which has no meaning. When you
 use such
   a syntax, please ensure that one of the two following points is
 verified:

   - The method checks that all the arguments that it is given are actually
 used,
     and raises an exception otherwise

   - The method forwards all of `args` and `kwds` to another function

   This way we make sure that all arguments are read at least once, and
 that none
   of the input is ignored. This is especially useful to detect typos like
   `Sandpile(weithged=True)`, which would otherwise return no warning.

 - All functions should have an INPUT and a TEST section:

   http://www.sagemath.org/doc/developer/coding_basics.html#the-docstring-
 of-a-function-content

 Nathann

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