From d6b8fb9ea28302c433046d569219492001956ec6 Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Wed, 12 Jan 2022 22:59:17 -0600 Subject: [PATCH] Implements `LazilyUnpicklingList.__(add|mul)__` --- loopy/tools.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loopy/tools.py b/loopy/tools.py index 9216cbc19..d12ff750c 100644 --- a/loopy/tools.py +++ b/loopy/tools.py @@ -501,6 +501,12 @@ def insert(self, key, value): def __getstate__(self): return {"_list": [_PickledObject(val) for val in self._list]} + def __add__(self, other): + return self._list + other + + def __mul__(self, other): + return self._list * other + class LazilyUnpicklingListWithEqAndPersistentHashing(LazilyUnpicklingList): """A list which lazily unpickles its values, and supports equality comparison