Changeset 843
- Timestamp:
- 11/23/15 06:38:51 (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/abstract_solver.py
r835 r843 840 840 return 841 841 842 def __copy__(self): 843 cls = self.__class__ 844 result = cls.__new__(cls) 845 result.__dict__.update(self.__dict__) 846 return result 847 848 def __deepcopy__(self, memo): 849 import copy 850 import dill 851 cls = self.__class__ 852 result = cls.__new__(cls) 853 memo[id(self)] = result 854 for k, v in self.__dict__.items(): 855 if v is self._cost: 856 setattr(result, k, tuple(dill.copy(i) for i in v)) 857 else: 858 try: #XXX: work-around instancemethods in python2.6 859 setattr(result, k, copy.deepcopy(v, memo)) 860 except TypeError: 861 setattr(result, k, dill.copy(v)) 862 return result 863 842 864 # extensions to the solver interface 843 865 evaluations = property(__evaluations )
Note: See TracChangeset
for help on using the changeset viewer.