Replace == None with is

This commit is contained in:
Salvo 'LtWorf' Tomaselli 2017-07-02 12:50:48 +02: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

View File

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

View File

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

View File

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