From 962a6b665a80a7fbbdd2d972e011af625cb016dd Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 5 Mar 2016 00:41:50 +0200 Subject: [PATCH] __len__ and __bool__ for world list proxies. --- koperkapel/world.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koperkapel/world.py b/koperkapel/world.py index b0e3deb..6a81f4c 100644 --- a/koperkapel/world.py +++ b/koperkapel/world.py @@ -128,3 +128,9 @@ class WorldListProxy(WorldBaseProxy): def __getitem__(self, index): return _maybe_subproxy(self, index, self._state[index]) + + def __len__(self): + return len(self._state) + + def __bool__(self): + return bool(self._state) -- 2.34.1