def __getitem__(self, name):
        """
        Implementation of the "lazyness" / cache mechanism
        :param name:
        :return:
        """
        if name in self.inner_dict.keys():
            # already retrieved: return the cached value
            return self.inner_dict[name]

        elif name in self.lazyloadable_keys:
            # not yet retrieved: load the value
            val = self.loading_method(name)
            # remember it for next time
            self.inner_dict[name] = val
            return val
        else:
            # unknown key: error as usual
            raise KeyError(name)
def __getitem__ ( self , name ) : if name in self . inner_dict . keys ( ) : return self . inner_dict [ name ] elif name in self . lazyloadable_keys : val = self . loading_method ( name ) self . inner_dict [ name ] = val return val else : raise KeyError ( name )
Implementation of the "lazyness" / cache mechanism
        :param name:
        :return: