diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-05 07:01:53 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-05 07:02:54 +0100 |
| commit | 087bc506d25b20b759a092a7490942e9cb212720 (patch) | |
| tree | 41569ca724be49cca976fe8bda14ed5e14547828 /examples/print_tree.py | |
| parent | 182772455a18e6af38f0935a984f4ef1bdfc9221 (diff) | |
Simplify redundant 'is (not) None' tests in examples
Diffstat (limited to 'examples/print_tree.py')
| -rw-r--r-- | examples/print_tree.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/print_tree.py b/examples/print_tree.py index 9d9eac2..cda9ce2 100644 --- a/examples/print_tree.py +++ b/examples/print_tree.py @@ -45,7 +45,7 @@ def indent_print(s, indent): print((" " * indent) + s) def print_items(node, indent): - while node is not None: + while node: if isinstance(node.item, Symbol): indent_print("config " + node.item.name, indent) @@ -58,7 +58,7 @@ def print_items(node, indent): elif node.item == COMMENT: indent_print('comment "{0}"'.format(node.prompt[0]), indent) - if node.list is not None: + if node.list: print_items(node.list, indent + 2) node = node.next |
