summaryrefslogtreecommitdiff
path: root/examples/allyesconfig.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/allyesconfig.py
parent182772455a18e6af38f0935a984f4ef1bdfc9221 (diff)
Simplify redundant 'is (not) None' tests in examples
Diffstat (limited to 'examples/allyesconfig.py')
-rw-r--r--examples/allyesconfig.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/allyesconfig.py b/examples/allyesconfig.py
index 1c85d60..b1d2cf6 100644
--- a/examples/allyesconfig.py
+++ b/examples/allyesconfig.py
@@ -40,19 +40,19 @@ while 1:
# template for how you can avoid recursing on both. The same logic is found
# in the C implementation.
- if node.list is not None:
+ if node.list:
# Jump to child node if available
node = node.list
- elif node.next is not None:
+ elif node.next:
# Otherwise, jump to next node if available
node = node.next
else:
# Otherwise, look for parents with next nodes to jump to
- while node.parent is not None:
+ while node.parent:
node = node.parent
- if node.next is not None:
+ if node.next:
node = node.next
break
else:
@@ -60,7 +60,7 @@ while 1:
break
# Collect all symbols that are not in choices
-non_choice_syms = [sym for sym in conf.defined_syms if sym.choice is None]
+non_choice_syms = [sym for sym in conf.defined_syms if not sym.choice]
while 1:
no_changes = True
@@ -87,8 +87,7 @@ while 1:
# Does the choice have a default selection that we haven't already
# selected?
- if selection is not None and \
- selection is not choice.user_selection:
+ if selection and selection is not choice.user_selection:
# Yup, select it
selection.set_value(2)