From: Simon Cross Date: Sat, 5 Mar 2016 11:07:04 +0000 (+0200) Subject: Add __getitem__ and __setitem__ for WorldDictProxy. X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=f21ab7ca426048a66640c8651bb6b015485a9770;p=koperkapel.git Add __getitem__ and __setitem__ for WorldDictProxy. --- diff --git a/koperkapel/world.py b/koperkapel/world.py index 2272a7a..d682949 100644 --- a/koperkapel/world.py +++ b/koperkapel/world.py @@ -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. """