Add __getitem__ and __setitem__ for WorldDictProxy.
authorSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 11:07:04 +0000 (13:07 +0200)
committerSimon Cross <hodgestar@gmail.com>
Sat, 5 Mar 2016 11:07:04 +0000 (13:07 +0200)
koperkapel/world.py

index 2272a7a3f01c1df2a695552e109fc6123c1c2888..d68294949f46a7d520275a19532737cdc02db7c5 100644 (file)
@@ -124,6 +124,12 @@ class WorldDictProxy(WorldBaseProxy):
         value = self._state.get(name)
         return _maybe_subproxy(self, name, value)
 
+    def __setitem__(self, name, value):
+        return self.__setattr__(name, value)
+
+    def __getitem__(self, name):
+        return self.__getattr__(name)
+
 
 class WorldListProxy(WorldBaseProxy):
     """ World list proxy that records changes and produces events. """