'lazily compute value for name or raise AttributeError if unknown.'

def __makeattr(self, name):

    target = None
    if ('__onfirstaccess__' in self.__map__):
        target = self.__map__.pop('__onfirstaccess__')
        importobj(*target)()
    try:
        (modpath, attrname) = self.__map__[name]
    except KeyError:
        if ((target is not None) and (name != '__onfirstaccess__')):
            return getattr(self, name)
        raise AttributeError(name)
    else:
        result = importobj(modpath, attrname)
        setattr(self, name, result)
        try:
            del self.__map__[name]
        except KeyError:
            pass
        return result
