From 9a44da4488a0ff00150eb5cb114f74ba560b96a6 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 04 Dec 2009 05:58:29 +0000 Subject: Creator, Remote : Dual code review power! --- (limited to 'tutorius/properties.py') 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): """ -- cgit v0.9.1