Skip to content

Commit

Permalink
TupleTernaryExpr should define its own length instead of inherit
Browse files Browse the repository at this point in the history
  • Loading branch information
aaw committed May 9, 2024
1 parent f622e98 commit cb315f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cnfc/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ def __init__(self, cond, if_true, if_false):
def __repr__(self):
return '{}({},{},{})'.format(self.__class__.__name__, self.cond, self.if_true, self.if_false)

def __len__(self):
return max(len(self.if_true), len(self.if_false))

def evaluate(self, formula):
t1 = self.if_true.evaluate(formula)
t2 = self.if_false.evaluate(formula)
Expand Down

0 comments on commit cb315f6

Please sign in to comment.