[gnome-tweaks] cleanup: Use "is None" instead of "== None"



commit ee638386a698e877baa3e11aa932d1ef11558769
Author: prakashdanish <grafitykoncept gmail com>
Date:   Sun Oct 7 20:16:29 2018 -0400

    cleanup: Use "is None" instead of "== None"
    
    "is" is used for identity testing
    Is this a None type object?
    
    "==" is used for value testing
    Is this equal to 42?

 gtweak/tweakmodel.py | 2 +-
 gtweak/utils.py      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
index 7c52e46..b890b33 100644
--- a/gtweak/tweakmodel.py
+++ b/gtweak/tweakmodel.py
@@ -35,7 +35,7 @@ class Tweak(object):
         self._search_cache = None
 
     def search_matches(self, txt):
-        if self._search_cache == None:
+        if self._search_cache is None:
             self._search_cache = string_for_search(self.name) + " " + \
                                 string_for_search(self.description)
             try:
diff --git a/gtweak/utils.py b/gtweak/utils.py
index 07b7ab9..ae47004 100644
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -236,7 +236,7 @@ class SchemaList:
 
     def __init__(self):
 
-        if SchemaList.__list == None:
+        if SchemaList.__list is None:
             SchemaList.__list = []
 
     def get(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]