Closed scainet closed 1 year ago
What would the use case be for this?
I would be interested in this.
My use case is the following: I have a list of tuples containing a rule and an action. If there are two matching rules, only the first action will be executed.
As a sanity check I would like to iterate over the rules to identify rules that would never be evaluated. Something like this:
r1 = rule_engine.Rule("a == 'HELLO'")
r2 = rule_engine.Rule("a == 'HELLO' and b == 'WORLD'")
if r1 > r2:
print("Warning: Rule `r2` will never be evaluated.")
(Not sure the normal comparison operators are very intuitive here)
May be interesting make Rule comparison