From dd67894834d779742e60c61d6efaa6898266e497 Mon Sep 17 00:00:00 2001 From: Sebastian Brix Date: Thu, 19 Jul 2018 13:48:36 +0200 Subject: [PATCH] - fix: initialize missing cache with empty tuple and not with empty list - fix: provide valid callback to update() --- supcon/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supcon/cache.py b/supcon/cache.py index d97a757..0f8169f 100644 --- a/supcon/cache.py +++ b/supcon/cache.py @@ -44,7 +44,7 @@ class LocalEventCache(supcon.intf.Implementation): supcon.intf.Implementation.__init__(self, EventCacheIntf) self.__local = local - self.__store = store([]) + self.__store = store(()) self.__maxEvents = maxEvents self.__watches = {} @@ -170,7 +170,7 @@ class RemoteEventCache(supcon.util.EventEmitterMixin): if outArgs['first'] > self.__store.value: amount = outArgs['first'] - self.__store.value - self.__store.update((outArgs['first']).__add__(0)) + self.__store.update(lambda v: outArgs['first']) self._emit('missing', amount=amount) for number, path, intf, event, args in outArgs['events']: -- 2.34.1