I'm thinking more about how to make the Graph class easy to use. One thing that crops up is that the operations that combine graphs only combine two graphs at a time (e.g., g.union(h), where g and h are graphs).
Is there a way to define an infix operator that would allow one to say: g union h union i union j union k? I could do it with something like: reduce(lambda x,y: x.union(y), [g,h,i,j,k]) But that doesn't seem as clear as the infix things above. For reference, Mathematica allows an operator in backticks to be applied to its surrounding arguments, so the equivalent operation above would be: g `union` h `union` i `union` j `union` k And of course, you can set whether the operator is left-associative or right-associative. Of course, one solution is to use a for loop: newgraph=Graph() for graph in [g,h,i,j,k]: newgraph.union(graph) But that seems a lot clunkier than the infix expression above. I guess another solution is to return the new graph from the union, so that you could do: g.union(h).union(i).union(j) Thoughts? -Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---