-
-
Notifications
You must be signed in to change notification settings - Fork 296
Move safe_infer()
to util
#2232
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
Move safe_infer()
to util
#2232
Conversation
a8c8317
to
af77796
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2232 +/- ##
==========================================
- Coverage 92.93% 92.80% -0.13%
==========================================
Files 94 94
Lines 10926 10930 +4
==========================================
- Hits 10154 10144 -10
- Misses 772 786 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Haven't look at the code, but on a higher level: does it make sense to move this to util/inference.py
?
That way we could define safe_infer
, infer_all
and some of the other inference utilities we need in pylint
into one shared "API".
I'm open to it, but I'd want to think carefully about it. Are you suggesting importing the astroid helpers and using those in pylint instead of the pylint helpers? The pylint safe_infer is a lot fancier. Could be a potential performance hit to port it to astroid and use it all the time there. |
That's a good concern indeed. Let's keep it as is in this PR. |
Thanks for the review! |
I'll squash in the precommit fix. I undid it locally because I wasn't altering that code and figured I was on a newer version of ruff locally, but I guess not. I'll add a test for the deprecation warning while at it |
safe_infer() was moved to astroid.util
80bc234
to
cbc4fb8
Compare
Missing line is just being moved from one location to another, so overriding the patch coverage check. |
Type of Changes
Description
Avoid some circular imports by moving
safe_infer()
toutil
. Discussed at #2171 (comment).Also, Remove shims for OperationError in exceptions module