xmlclass/xmlclass.py
changeset 1743 c3c3d1318130
parent 1739 ec153828ded2
child 1744 69dfdb26f600
--- a/xmlclass/xmlclass.py	Tue Aug 15 16:48:49 2017 +0300
+++ b/xmlclass/xmlclass.py	Tue Aug 15 17:01:51 2017 +0300
@@ -596,7 +596,7 @@
         "extract": ExtractTag,
         "generate": GenerateTag,
         "initial": lambda: None,
-        "check": lambda x: x == None or infos["minOccurs"] == 0 and value == True
+        "check": lambda x: x is None or infos["minOccurs"] == 0 and value == True
     }
 
 
@@ -1535,7 +1535,7 @@
                     if instance is None and elements[parts[0]]["minOccurs"] == 0:
                         instance = elements[parts[0]]["elmt_type"]["initial"]()
                         setattr(self, parts[0], instance)
-                    if instance != None:
+                    if instance is not None:
                         if len(parts) > 1:
                             instance.setElementValue(parts[1], value)
                         else: