#11739: add_vertex w/o params should return the new vertex
-------------------------------+--------------------------------------------
   Reporter:  ddestrada        |          Owner:  jason, ncohen, rlm
       Type:  enhancement      |         Status:  needs_work        
   Priority:  minor            |      Milestone:  sage-5.0          
  Component:  graph theory     |       Keywords:  add_vertex sd35.5 
Work_issues:                   |       Upstream:  N/A               
   Reviewer:  Paul Zimmermann  |         Author:  Lukáš Lánský      
     Merged:                   |   Dependencies:                    
-------------------------------+--------------------------------------------

Comment(by brunellus):

 Replying to [comment:6 zimmerma]:
 > However, shouldn't we do the same for {{{add_vertices}}} for
 consistency?
 > {{{
 > sage: G=Graph()
 > sage: G.add_vertex()
 > 0
 > sage: G.add_vertices([None])
 > }}}

 That could be useful, but there is this problem: what to do if there are
 no None-labeled vertices in the input? Returning an empty list is
 consistent, but in most cases, where the feature won't be used, this looks
 just weird and None would be much better:

 {{{
 sage: G.add_vertices([1, 3])
 []
 }}}

 > Note the following strange thing:
 > {{{
 > sage: G=Graph()
 > sage: G.add_vertices([None,0])
 > sage: G.vertices()
 > [0]
 > }}}
 > thus we added only one vertex.

 Good point. I guess it makes better sense to add named vertices first.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11739#comment:12>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to