summaryrefslogtreecommitdiff
path: root/examples/help_grep.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-11-05 07:01:53 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-11-05 07:02:54 +0100
commit087bc506d25b20b759a092a7490942e9cb212720 (patch)
tree41569ca724be49cca976fe8bda14ed5e14547828 /examples/help_grep.py
parent182772455a18e6af38f0935a984f4ef1bdfc9221 (diff)
Simplify redundant 'is (not) None' tests in examples
Diffstat (limited to 'examples/help_grep.py')
-rw-r--r--examples/help_grep.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/help_grep.py b/examples/help_grep.py
index 6f54583..b9e1440 100644
--- a/examples/help_grep.py
+++ b/examples/help_grep.py
@@ -44,7 +44,7 @@ if len(sys.argv) < 3:
search = re.compile(sys.argv[2], re.IGNORECASE).search
def search_tree(node):
- while node is not None:
+ while node:
match = False
if isinstance(node.item, (Symbol, Choice)) and \
@@ -63,7 +63,7 @@ def search_tree(node):
if match:
print("location: {}:{}\n".format(node.filename, node.linenr))
- if node.list is not None:
+ if node.list:
search_tree(node.list)
node = node.next