projects
/
koperkapel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53c9067
)
__len__ and __bool__ for world list proxies.
author
Simon Cross
<hodgestar@gmail.com>
Fri, 4 Mar 2016 22:41:50 +0000
(
00:41
+0200)
committer
Simon Cross
<hodgestar@gmail.com>
Fri, 4 Mar 2016 22:41:50 +0000
(
00:41
+0200)
koperkapel/world.py
patch
|
blob
|
history
diff --git
a/koperkapel/world.py
b/koperkapel/world.py
index b0e3debfd16d830ee8d030aee2aa2eb4e5be8a3a..6a81f4c8a958fff21d419a1ee762c653e14828df 100644
(file)
--- 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)