def __init__(self, operands: List[Expression], variable_name=None) -> None:
        """Create an operation expression.

        Args:
            *operands
                The operands for the operation expression.

        Raises:
            ValueError:
                if the operand count does not match the operation's arity.
            ValueError:
                if the operation contains conflicting variables, i.e. variables with the same name that match
                different things. A common example would be mixing sequence and fixed variables with the same name in
                one expression.
        """
        super().__init__(variable_name)

        operand_count, variable_count = self._count_operands(operands)

        if not variable_count and operand_count < self.arity.min_count:
            raise ValueError(
                "Operation {!s} got arity {!s}, but got {:d} operands.".
                format(type(self).__name__, self.arity, operand_count)
            )

        if self.arity.fixed_size and operand_count > self.arity.min_count:
            msg = "Operation {!s} got arity {!s}, but got {:d} operands.".format(
                type(self).__name__, self.arity, operand_count
            )
            if self.associative:
                msg += " Associative operations should have a variadic/polyadic arity."
            raise ValueError(msg)

        self.operands = operands
def __init__ ( self , operands : List [ Expression ] , variable_name = None ) -> None : super ( ) . __init__ ( variable_name ) operand_count , variable_count = self . _count_operands ( operands ) if not variable_count and operand_count < self . arity . min_count : raise ValueError ( "Operation {!s} got arity {!s}, but got {:d} operands." . format ( type ( self ) . __name__ , self . arity , operand_count ) ) if self . arity . fixed_size and operand_count > self . arity . min_count : msg = "Operation {!s} got arity {!s}, but got {:d} operands." . format ( type ( self ) . __name__ , self . arity , operand_count ) if self . associative : msg += " Associative operations should have a variadic/polyadic arity." raise ValueError ( msg ) self . operands = operands
Create an operation expression.

        Args:
            *operands
                The operands for the operation expression.

        Raises:
            ValueError:
                if the operand count does not match the operation's arity.
            ValueError:
                if the operation contains conflicting variables, i.e. variables with the same name that match
                different things. A common example would be mixing sequence and fixed variables with the same name in
                one expression.