Skip to content
Snippets Groups Projects
Commit 47c28c5b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Implement __setitem__ for ConfigObject to add container protocol compatibility.

parent 6bf0c9bb
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,11 @@ class ConfigObject(object):
(type(self).__name__, name))
return None
def __setitem__(self, key, value):
if key not in self.__slots__:
raise KeyError, key
setattr(self, key, value)
def __getstate__(self):
state = {}
for name in self.__slots__:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment