template=template,
check_units=check_units,
level=self.level + 1)
elif isinstance(item, basestring):
try:
value = float(value)
except (TypeError, ValueError):
raise TypeError("When setting a variable based on a string ",
"index, the value has to be a string or a "
"scalar.")
check_units = self.unit is not Nonetemplate = "group_variable_set_conditional"
self.group._set_with_code_conditional(variable, item, repr(value),
template=template,
check_units=check_units,
level=self.level + 1)