File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -232,8 +232,11 @@ def __init__(self, *operands):
232
232
self .operands = operands
233
233
234
234
def evaluate (self , calculator , divide = False ):
235
- operands = [operand .evaluate (calculator , divide = True ) for operand in self .operands ]
236
- return Boolean (any (operands ))
235
+ for operand in self .operands :
236
+ value = operand .evaluate (calculator , divide = True )
237
+ if value :
238
+ return value
239
+ return value
237
240
238
241
239
242
class AllOp (Expression ):
@@ -244,8 +247,11 @@ def __init__(self, *operands):
244
247
self .operands = operands
245
248
246
249
def evaluate (self , calculator , divide = False ):
247
- operands = [operand .evaluate (calculator , divide = True ) for operand in self .operands ]
248
- return Boolean (all (operands ))
250
+ for operand in self .operands :
251
+ value = operand .evaluate (calculator , divide = True )
252
+ if not value :
253
+ return value
254
+ return value
249
255
250
256
251
257
class NotOp (Expression ):
You can’t perform that action at this time.
0 commit comments