Commits

Anonymous committed b8fb9ca

add comparison methods to complex xml types

  • Participants
  • Parent commits 9ac9746

Comments (0)

Files changed (1)

 
     return res
 
+def equal(x1, x2):
+    return x1.__dict__ == x2.__dict__
+
+def notequal(x1, x2):
+    return not(equal(x1, x2))
+
 class XMLType(object):
     """
         Base xml schema type.
         clsDict["__repr__"] = tostr
         #add complex init
         clsDict["__init__"] = toinit
+        #comparison
+        clsDict["__eq__"] = equal
+        clsDict["__ne__"] = notequal
 
         #extend children list with that of base classes
         new = []