-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flatten AND and OR conditions #173
Conversation
Previously, AND and OR conditions with more than two elements would lead to nested ANDs and ORs, making the resulting expression much more complicated and harder to read/understand. This change flattens AndCondition and OrCondition objects when they're combined.
12e13d8
to
ce6e63f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall thoughts, sorry if imprecise.
I feel that the only use for the new class is the isinstance
test.
Everything else is a regular tuple.
Would it be better to subclass a plain tuple
instead?
And I managed to get it all wrong. |
I've tried to express my thoughts on refactoring in #174, pull it in if you deem it worthy 🙇🏻 |
|
Previously, AND and OR conditions with more than two elements would lead to nested ANDs and ORs, making the resulting expression much more complicated and harder to read/understand. This change flattens AndCondition and OrCondition objects when they're combined.
Context: had to debug some complicated conditions (~10 AND's) and the extreme nesting makes it super hard to debug/read them.
Not a huge fan of the nameMinLen2AppendOnlyList
so if someone has a better suggestion I'd love to hear it.