On Tue, 16 Dec 2008 17:37:37 -0600
"Edward K. Ream" <[email protected]> wrote:
> > I wonder if fewer things would break if children_iter() also ignored
> > nodes already seen unless an optional keyword argument was set True?
> > Maybe see whether that's needed or not when the time comes.
>
> I think changing children_iter is asking for trouble and confusion.
>
> Why change children_iter? There is no danger: it gives only the
> direct children. We don't children to go missing just because they
> are also back links, do we?
I wonder if they're might be code which does its own recursion using
children_iter(), I suspect I've used that pattern in places...
def doSomething(p):
for c in p.children_iter():
# do something using p and c together, then
doSomething(c)
ideally this would never be written, .subtree_iter() would be used
instead. So let's assume it's not a problem, if it turns out to be a
problem children_iter() can default to hiding nodes already seen unless
told not to.
Cheers -Terry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" 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/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---