Replace == None with is

master
Salvo 'LtWorf' Tomaselli 2017-07-02 12:50:48 +07:00
parent f459f0635a
commit 7a88dc9076
No known key found for this signature in database
GPG Key ID: B3A7CF0C801886CF
3 changed files with 7 additions and 7 deletions

@ -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

@ -35,7 +35,7 @@ class creatorForm(QtWidgets.QDialog):
self.ui = ui
self.table = self.ui.table
if self.rel == None:
if self.rel is None:
self.setup_empty()
else:
self.setup_relation(self.rel)

@ -239,7 +239,7 @@ class relForm(QtWidgets.QMainWindow):
'''Shows the selected relation into the table'''
self.ui.table.clear()
if rel == None: # No relation to show
if rel is None: # No relation to show
self.ui.table.setColumnCount(1)
self.ui.table.headerItem().setText(0, "Empty relation")
return
@ -347,7 +347,7 @@ class relForm(QtWidgets.QMainWindow):
from relational_gui import creator
result = creator.edit_relation()
if result == None:
if result is None:
return
name = self.promptRelationName()
@ -383,7 +383,7 @@ class relForm(QtWidgets.QMainWindow):
pass
def showSurvey(self):
if self.Survey == None:
if self.Survey is None:
self.Survey = surveyForm.surveyForm()
ui = survey.Ui_Form()
self.Survey.setUi(ui)
@ -392,7 +392,7 @@ class relForm(QtWidgets.QMainWindow):
self.Survey.show()
def showAbout(self):
if self.About == None:
if self.About is None:
self.About = QtWidgets.QDialog()
ui = about.Ui_Dialog()
ui.setupUi(self.About)