def __add__()

in runtool/runtool/datatypes.py [0:0]


    def __add__(self, other) -> Any:
        """
        Merges multiple instances of the same Node type into an instance of
        the class stored in the `self.result_type` variable.
        This allows any classes inheriting from `Node` to customize the
        return type of __add__ without redefining the logic.
        """
        if isinstance(other, type(self)):
            return self.result_type([self, other])
        elif isinstance(other, self.result_type):
            return self.result_type([self]) + other

        raise TypeError