def METHOD_NAME(self, other):
    if isinstance(other, Nodegraph):
        return self._methodcall(lib.nodegraph_update, other._objptr)
    elif isinstance(other, MinHash):
        return self._methodcall(lib.nodegraph_update_mh, other._objptr)
    else:
        # FIXME: we could take sets here too (or anything that can be
        # converted to a list of ints...)
        raise TypeError("Must be a Nodegraph or MinHash")