"Heiko Wundram" <me+python-dev at modelnine.org> wrote in message news:200605211710.51720.me+python-dev at modelnine.org... > 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> Isn't this the same as for node in tree: if node.haschildren(): <do something with node> so that all you would save is ':\n' and the extra indents? tjr
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4