def _instance_namespace(instance, dct, name):
    """Return a Namespace associated with the instance, if possible."""
    try:
        return dct.get_namespace(instance, dct.path)
    except TypeError:
        raise AttributeError(name)