def __truediv__(self, value): if type(value) in [int, float] and value != 0: base_variable = composition_sequence_from_value([self._state], self._state)[-1] if base_variable._arithmetic_build: self._state._arithmetic_stack.append( formula_tree.ArithmeticTrueDivide(value)) return self else: raise Exception( "Value used to divide quantity %s must be non-zero and of type int or float." % self)
def __truediv__(self, value): if self._state._arithmetic_build: self._state._arithmetic_stack.append( formula_tree.ArithmeticTrueDivide(value)) return self