My class has a dict, for example:
class MyClass(object): def __init__(self): self.data = {\'a\': \'v1\', \'b\': \'v2\'}
Then I
I think this implement is cooler
class MyClass(object): def __init__(self): self.data = {'a': 'v1', 'b': 'v2'} def __getattr__(self,key): return self.data.get(key,None)