Exemple #1
0
 def __sub__(self, value):
     if type(value) in [int, float]:
         base_variable = composition_sequence_from_value([self._state],
                                                         self._state)[-1]
         if base_variable._arithmetic_build:
             self._state._arithmetic_stack.append(
                 formula_tree.ArithmeticSubtract(value))
         return self
     else:
         raise Exception(
             "Value subtracted from quantity %s must be of type int or float."
             % self)
 def __sub__(self, value):
     if self._state._arithmetic_build:
         self._state._arithmetic_stack.append(
             formula_tree.ArithmeticSubtract(value))
     return self