def deferred_value(name, val):
    """
    Safely get a value that may not exist.
    Raise LookupError on the name if the value doesn't exist.
    This is intended as a helper for getters.
    """
    if val:
        return val
    raise LookupError(f'{name} not ready')