Replace == None with is

This commit is contained in:
Salvo 'LtWorf' Tomaselli
2017-07-02 12:50:48 +02:00
parent f459f0635a
commit 7a88dc9076
3 changed files with 7 additions and 7 deletions

View File

@@ -108,7 +108,7 @@ class Node:
def __init__(self, expression: Optional[list] = None) -> None:
'''Generates the tree from the tokenized expression
If no expression is specified then it will create an empty node'''
if expression == None or len(expression) == 0:
if expression is None or len(expression) == 0:
return
# If the list contains only a list, it will consider the lower level list.
@@ -351,7 +351,7 @@ def tokenize(expression: str) -> list:
while len(expression) > 0:
if expression.startswith('('): # Parenthesis state
end = _find_matching_parenthesis(expression)
if end == None:
if end is None:
raise TokenizerException(
"Missing matching ')' in '%s'" % expression)
# Appends the tokenization of the content of the parenthesis