diff options
Diffstat (limited to 'tutorius/properties.py')
-rw-r--r-- | tutorius/properties.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/tutorius/properties.py b/tutorius/properties.py index 85e8aa5..f273569 100644 --- a/tutorius/properties.py +++ b/tutorius/properties.py @@ -140,26 +140,8 @@ class TPropContainer(object): """ return deepcopy(self._props) - # Providing the hash methods necessary to use TPropContainers - # in a dictionary, according to their properties - def __hash__(self): - # many places we use containers as keys to store additional data. - # Since containers are mutable, there is a need for a hash function - # where the result is constant, so we can still lookup old instances. - return self.__id - def __eq__(self, e2): - return self.__id == e2.__id or \ - (isinstance(e2, type(self)) and self._props == e2._props) - - # Adding methods for pickling and unpickling an object with - # properties - def __getstate__(self): - return dict(id=self.__id, props=self._props.copy()) - - def __setstate__(self, dict): - self.__id = dict['id'] - self._props.update(dict['props']) + return (isinstance(e2, type(self)) and self._props == e2._props) class TutoriusProperty(object): """ |