Skip to content

Commit 2bd91e3

Browse files
committed
feat(EventHandlers): 支持使用运算符组合规则
- 新增支持使用 `&` (逻辑与) 和 `|` (逻辑或) 运算符来组合规则 - 简化了规则的定义和阅读,使得代码更加 Pythonic - 例如:`rule1 & rule2`等价于 `AllRule(rule1, rule2)` - 例如:`rule1 | rule2`等价于 `AnyRule(rule1, rule2)` - 推荐使用运算符来组合两个规则,对于组合两个以上的规则或希望代码更明确表达意图时,仍然可以直接使用 `AllRule` 和 `AnyRule` 类
1 parent 8ce3675 commit 2bd91e3

File tree

1 file changed

+80
-40
lines changed

1 file changed

+80
-40
lines changed

0 commit comments

Comments
 (0)