Heiko Wundram wrote: ... > As I've noticed that I find myself typing the latter quite often > in code I write, it would only be sensible to add the corresponding > syntax for the for statement: > > 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>
Mhhh, your unsugared form remind me of darks hours with primitive BASICS in my youth - the kind Dijsktra commented on. Why don't you write for node in tree: if node.haschildren(): <do something with node> ? -- http://mail.python.org/mailman/listinfo/python-list