On Oct 3, 2009, at 1:38 PM, Tom Boothby wrote:

> On Sat, Oct 3, 2009 at 12:52 PM, Rob Beezer  
> <goo...@beezer.cotse.net> wrote:
>>
>> On Oct 3, 2:47 am, Nathann Cohen <nathann.co...@gmail.com> wrote:
>>> DiGraph.out_neighbors() and DiGraph.in_neighbors() would be much  
>>> easier to
>>> find and more natural...
>>
>> I'd suggest
>>
>> neighbors_in()
>> neighbors_out()
>> neighbors()
>
> Now that *is* more natural.  Introspection on graphs is a bit of a
> nightmare right now, thanks the the gobs of features that have been
> implemented.  I wonder -- could we somehow consolidate things?  My
> first idea is to break methods off into subobjects somehow;
>
> G.neighbors()
> G.neighbors.iterator()
> G.neighbors.in()
> G.neighbors.in.iterator()
> ...
>
> This would clean up tab completion, and maybe even make it possible to
> break the 12k line graph.py into more files.  Thoughts?

Sounds good, but perhaps even more natural to have G.neighbors be  
iterable and use the __iter__ method on it, rather than .iterator().  
Then you can do list(G.neighbors()).

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to