Commits

Anonymous committed 517aeae

adding __eq__ tests

Comments (0)

Files changed (1)

         else:
             return type(self).__name__ + "(" + repr(self.value) + ")"
 
-    
+    def __eq__(self, other):
+        if type(self) == type(other) and str(self) == str(other):
+            return True
+        else:
+            return False
+
+
 class List(list):
     """A List of things."""
 
         return ''.join((type(self).__name__, "(", super(List, self).__repr__(),
             ")"))
 
+    def __eq__(self, other):
+        return super(List, self).__eq__(list(other))
+
 
 class _UserDict(object):
     # UserDict cannot be used because of metaclass conflicts
                         break
                     else:
                         t = t2
-                        if r != None:
+                        if r is not None:
                             if type(r) is list:
                                 L.extend(r)
                             else: