def add_constraint(self, func, variables, default_values=None):
        """Adds a constraint that applies to one or more variables.

        The function must return true or false to indicate which combinations
        of variable values are valid.
        """
        self._constraints.append((func, variables, default_values or ()))
Adds a constraint that applies to one or more variables.

        The function must return true or false to indicate which combinations
        of variable values are valid.