diff --git a/loopy/tools.py b/loopy/tools.py index bf7785fcf..bb4904bf2 100644 --- a/loopy/tools.py +++ b/loopy/tools.py @@ -348,6 +348,9 @@ def unpickle(self): def __getstate__(self): return {"objstring": self.objstring} + def __repr__(self) -> str: + return type(self).__name__ + "(" + repr(self.unpickle()) + ")" + class _PickledObjectWithEqAndPersistentHashKeys(_PickledObject): """Like :class:`_PickledObject`, with two additional attributes: @@ -406,6 +409,9 @@ def __getstate__(self): key: _PickledObject(val) for key, val in self._map.items()}} + def __repr__(self) -> str: + return type(self).__name__ + "(" + repr(self._map) + ")" + # }}} @@ -444,6 +450,9 @@ def __add__(self, other): def __mul__(self, other): return self._list * other + def __repr__(self) -> str: + return type(self).__name__ + "(" + repr(self._list) + ")" + class LazilyUnpicklingListWithEqAndPersistentHashing(LazilyUnpicklingList): """A list which lazily unpickles its values, and supports equality comparison