Variables._append(v=None, permissive=False)[source]#

Append a new variable.

  • v (Variable, optional) – Add a new variable. If None, a new label will be generated. The generated label will be the index of the new variable if that index is available, otherwise it will be the lowest available non-negative integer.

  • 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.


The label of the appended variable.

Return type:



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


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