#19223: Graphs: missing error check for depth_first_search(..., distance=0)
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  defect             |       Status:  new
       Priority:  minor              |    Milestone:  sage-6.9
      Component:  graph theory       |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  
u/jmantysalo/graphs__missing_error_check_for_depth_first_search______distance_0_|
  ec0e5b3167db96d936ed1f70bb8dbbcb19201895
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jmantysalo):

 Replying to [comment:4 ncohen]:
 > 'Another way' may be to do this kind of replacement:
 >
 > {{{
 > #!diff
 > -queue=[(v,0) for v in reversed(start)]
 > +queue=[(v,0) for v in reversed(start) if v in self]
 > }}}
 >
 > The behaviour is a bit different, but well... What do you think?

 For every case, also to those with `distance != 0`? Sounds kind of
 dangerous.

 > we should really find something better than adding 30 lines of code to
 deal with a rather stupid corner-case

 Simple. We should have global internal functions for this. Like
 `_check_integer_all()`, `_check_integer_nonnegative()` and
 `_check_integer_positive()`. Then also error messages would be consistent.

 A topic for sage-devel?

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