Python loop | "do-while" over a tree
<p>Is there a more Pythonic way to put this loop together?:</p>

<pre><code>while True:
    children = tree.getChildren()
    if not children:
        break
    tree = children[0]
</code></pre>

<p>UPDATE:
I think this syntax is probably what I'm going to go with:</p>

<pre><code>while tree.getChildren():
    tree = tree.getChildren()[0]
</code></pre>
