From ea01c5200f06149c3ece055c576308601341144e Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sun, 6 Mar 2016 00:30:06 +0200 Subject: [PATCH] Poppable. --- koperkapel/world.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/koperkapel/world.py b/koperkapel/world.py index 14746f5..a07b719 100644 --- a/koperkapel/world.py +++ b/koperkapel/world.py @@ -66,6 +66,11 @@ class World: obj, key = self._get_obj(name) obj.append(value) + def _apply_pop(self, action, updates): + for name, pos in updates.items(): + obj, key = self._get_obj(name) + obj.pop(pos) + def _apply_reset(self, action): self._state = self._build_initial_state() @@ -156,3 +161,6 @@ class WorldListProxy(WorldBaseProxy): def append(self, value): self._top._record_change(self._prefix, value, action="append") + + def pop(self, pos=0): + self._top._record_change(self._prefix, pos, action="pop") -- 2.34.1