[omaha] expand my understanding...
wereapwhatwesow at gmail.com
Sun Dec 12 00:19:42 CET 2010
I am going thru a book on testing, and ran across the following code:
def __init__(self, *operands):
self.operands = operands
def evaluate(self, bindings):
vals = [x.evaluate(bindings) for x in self.operands]
if len(vals) < 2:
raise ValueError('multiply without at least two '
'operands is meaningless')
result = 1.0
for val in vals:
result *= val
The line " vals = [x.evaluate(bindings) for x in self.operands]"
appears to take operand(s) and put them into a list. I can't get my brain
to understand it. operands are any number of floating point numbers. Any
tips greatly appreciated.
More information about the Omaha