-
-
Notifications
You must be signed in to change notification settings - Fork 301
Support boolean truthiness constraints in inference #2823
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
Conversation
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2823 +/- ##
=======================================
Coverage 93.35% 93.35%
=======================================
Files 91 91
Lines 11100 11113 +13
=======================================
+ Hits 10362 10375 +13
Misses 738 738
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
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.
Looks amazing !
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.
Perhaps we should add a Changelog entry? Rest LGTM!
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.
Lovely, I'm glad more knowledge of the constraints interface is starting to spread πͺ
04eb2cb
c7a3eb0
to
04eb2cb
Compare
Thanks for the reviews! A lot of thought and effort went into the constraints interface, and it deserves to be built upon rather than left unused. More extensions coming soon in separate PRs! |
Type of Changes
Description
This PR builds on #1189 by implementing the constraint interface to handle boolean constraints, similar to how
None
constraints are currently treated.Previously, constraints only accounted for
None
checks:These changes support constraints derived from boolean truthiness:
True
, keep the inferred value.False
, filter out the inferred value.None
constraints.Closes pylint-dev/pylint#9515