code: def register_link(self, obj, attr=None):
          
          name = repr(self)
          if not name:
              return self
          l = self.__class__._get_links()
          if name not in l:
              l[name] = set()
          v = WeakAttrLink(obj, attr)
          if v not in l[name]:
              l[name].add(v)
          return self
docs: creates link from obj.attr to self
          :param obj: object to register link to
          :param attr: attribute name to register link to