2727> b = Argument(name="b")
2828> add.addLiteral(a)
2929> add.addLiteral(b)
30- > # make an Equation instance and pass the root
31- > eq = Equation(root = add)
32- > eq(a=3, b=4) # returns 7
33- > eq(a=2) # remembers b=4, returns 6
30+ > # make an Equation instance and pass the root > eq = Equation(root = add)
31+ > eq(a=3, b=4) # returns 7 > eq(a=2) # remembers b=4, returns 6
3432> eq.a.setValue(-3)
3533> eq.b.setValue(3)
3634> eq() # uses last assignment of a and b, returns 0
@@ -88,7 +86,6 @@ def __init__(self, name = None, root = None):
8886 root -- The root node of the Literal tree (default None). If root
8987 is not passed here, you must call the 'setRoot' method to
9088 set or change the root node.
91-
9289 """
9390 # Operator stuff. We circumvent Operator.__init__ since we're using
9491 # args as a property. We cannot set it, as the Operator tries to do.
@@ -110,8 +107,8 @@ def symbol(self):
110107 def operation (self , * args , ** kw ):
111108 """Evaluate this Equation object.
112109
113- Same as the __call__ method. This method is used via
114- the Operator interface.
110+ Same as the __call__ method. This method is used via the Operator
111+ interface.
115112
116113 Return the result of __call__(*args, **kw).
117114 """
@@ -150,7 +147,6 @@ def setRoot(self, root):
150147
151148 Raises:
152149 ValueError if errors are found in the Literal tree.
153-
154150 """
155151
156152 # Validate the new root
@@ -179,11 +175,10 @@ def __call__(self, *args, **kw):
179175 """Call the equation.
180176
181177 New Argument values are acceped as arguments or keyword assignments (or
182- both). The order of accepted arguments is given by the args
183- attribute. The Equation will remember values set in this way.
178+ both). The order of accepted arguments is given by the args attribute.
179+ The Equation will remember values set in this way.
184180
185- Raises
186- ValueError when a passed argument cannot be found
181+ Raises ValueError when a passed argument cannot be found
187182 """
188183 # Process args
189184 for idx , val in enumerate (args ):
@@ -206,7 +201,6 @@ def swap(self, oldlit, newlit):
206201 """Swap a literal in the equation for another.
207202
208203 Note that this may change the root and the operation interface
209-
210204 """
211205 newroot = swap (self .root , oldlit , newlit )
212206 self .setRoot (newroot )
0 commit comments