On Mon, Aug 8, 2011 at 12:32 PM, Terry Brown <[email protected]> wrote:
> On Mon, 8 Aug 2011 12:24:42 -0500
> Kent Tenney <[email protected]> wrote:
>
>>     while True:
>>         if not parent:
>>             break
>>         parents.insert(0, parent.h)
>>         parent = parent.getParent()
>
> That seems reasonable,
>
>    while parent:
>        parents.insert(0, parent.h)
>        parent = parent.getParent()
>
> does the same thing a little more succinctly.

Right. I tend to get confused with this type of logic, I've
too often written it so that I try to call something on None.

Your loop doesn't start for a root node, correctly stops
upon reaching root, without the annoying confusing
unnecessary redundant repetitive superfluous verbosity.

Thanks,
Kent

>
> 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.
>
>

-- 
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.

Reply via email to