'Return an attribute resolution method.
This builds a resolver without a strong reference to this resource, to
break a possible cycle.'

@staticmethod
def _make_resolver(ref):

    def resolve(attr):
        res = ref()
        if (res is None):
            raise RuntimeError('Resource    collected')
        return res._resolve_all_attributes(attr)
    return resolve
