Code Cleanup: check is / is not when comparing singletons.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 2 Feb 2012 21:07:56 +0000 (21:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 2 Feb 2012 21:07:56 +0000 (21:07 +0000)
doc/blender_file_format/BlendFileDnaExporter_25.py
doc/blender_file_format/BlendFileReader.py
intern/cycles/app/io_export_cycles_xml.py
release/scripts/startup/bl_ui/properties_data_curve.py
source/blender/python/rna_dump.py
source/tests/bl_mesh_modifiers.py

index bc5b2e73c7e8681e0938c532de4c9f002f971e29..a201f618fbb0c1bc90f95dce0b4a25dcbff3af5a 100755 (executable)
@@ -206,13 +206,13 @@ class DNACatalogHTML:
                 <td>${size}</td>
             </tr>"""
         
-        if field.Type.Structure == None or field.Name.IsPointer():
+        if field.Type.Structure is None or field.Name.IsPointer():
 
             # ${reference}
             reference = field.Name.AsReference(parentReference)
 
             # ${struct}
-            if parentReference != None:
+            if parentReference is not None:
                 struct = '<a href="#{0}">{0}</a>'.format(structure.Type.Name)
             else:
                 struct = structure.Type.Name
@@ -240,7 +240,7 @@ class DNACatalogHTML:
             
             structure_field = Template(structure_field_template).substitute(d)
         
-        elif field.Type.Structure != None:
+        elif field.Type.Structure is not None:
             reference = field.Name.AsReference(parentReference)
             structure_field = self.StructureFields(field.Type.Structure, reference, offset) 
 
index 313c8c7ff5dfb26cb215279a24d9634ccb51db13..88eb71b3ce250482400cabce80d3fa82391ad325 100644 (file)
@@ -329,7 +329,7 @@ class DNAName:
         self.Name = name
         
     def AsReference(self, parent):
-        if parent == None:
+        if parent is None:
             result = ""
         else:
             result = parent+"."
index 2314d935214df1e0ac35aec1a3b8da169ae02a50..3ba9e201d11c42698f0f7eaa25ae7dc6e953b91b 100644 (file)
@@ -93,7 +93,7 @@ class ExportCyclesXML(bpy.types.Operator, ExportHelper):
 
     @classmethod
     def poll(cls, context):
-        return context.active_object != None
+        return (context.active_object is not None)
 
     def execute(self, context):
         filepath = bpy.path.ensure_ext(self.filepath, ".xml")
index f8e3d48d40cd50ade54b81c4c61594a1b54f720b..3aa995353b2e649c17b5aadda8be78cdb2169ac5 100644 (file)
@@ -166,7 +166,7 @@ class DATA_PT_geometry_curve(CurveButtonsPanel, Panel):
         col.prop(curve, "bevel_object", text="")
 
         row = col.row()
-        row.active = curve.bevel_object != None
+        row.active = (curve.bevel_object is not None)
         row.prop(curve, "use_fill_caps")
 
 
index df902886f30fa5d8c076b862b47561f378c9c7a9..489f011e693df326c875a0548a0596d6816a5677 100644 (file)
@@ -79,7 +79,7 @@ def seek(r, txt, recurs):
     except:
         keys = None
 
-    if keys != None:
+    if keys is not None:
         if PRINT_DATA:
             print(txt + '.keys() - ' + str(r.keys()))
 
index 917ccbc0d24f826bdb15a66c859f3c7f11907f26..0495f5d9f98cbca47b6312823562eb991eebff8c 100644 (file)
@@ -74,7 +74,7 @@ def render_gl(context, filepath, shade):
 
 def render_gl_all_modes(context, obj, filepath=""):
 
-    assert(obj != None)
+    assert(obj is not None)
     assert(filepath != "")
 
     scene = context.scene