Browse Source

[#45] Reimplemented the __eq__ method of the Model class so that it uses the newly defined __hash__ method

Roland Haroutiounian 9 years ago
parent
commit
873edf19a6
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      EditorialModel/model.py

+ 2
- 2
EditorialModel/model.py View File

@@ -29,8 +29,8 @@ class Model(object):
29 29
     def __hash__(self):
30 30
         return hashlib.md5(str({uid: component.__hash__ for uid, component in self._components.items()}).encode('utf-8')).hexdigest()
31 31
 
32
-    # def __eq__(self, other):
33
-    #     return self.__hash__() == other.__hash__()
32
+    def __eq__(self, other):
33
+        return self.__hash__() == other.__hash__()
34 34
 
35 35
     @staticmethod
36 36
     ## Given a name return an EmComponent child class

Loading…
Cancel
Save