Em Dom, 2006-05-21 às 17:11 +0200, Heiko Wundram escreveu: > for node in tree if node.haschildren(): > <do something with node> > > as syntactic sugar for: > > for node in tree: > if not node.haschildren(): > continue > <do something with node>
Today you can archive the same effect (but not necessarily with the same
performance) with:
for node in (x for x in tree if x.haschildren()):
<do something with node>
But that's ugly...
--
Felipe.
--
http://mail.python.org/mailman/listinfo/python-list
