dimod.variables.Variables._extend#

Variables._extend(iterable, permissive=False)[source]#

Add new variables.

Parameters:
  • iterable (iterable[Variable]) – An iterable of hashable objects.

  • permissive (bool, optional, default=False) – If False, appending a variable that already exists will raise a ValueError. If True, appending a variable that already exists will not change the container.

Raises:

ValueError – If the variable is present and permissive is False.

Caution

This method is semi-public. It is intended to be used by classes that have Variables as an attribute, not by the the user.