Skip to content
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

create NodeNG.inferred_best() and replace inferred()[0] #2066

Closed
wants to merge 2 commits into from

Conversation

ostr00000
Copy link
Contributor

Type of Changes

Type
✨ New feature
🔨 Refactoring

Description

Add inferred_best function to NodeNG interface.
Replace all code where inferred()[0] is used.

Closes #2065

@codecov
Copy link

codecov bot commented Mar 26, 2023

Codecov Report

Merging #2066 (282b75c) into main (598e4c3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2066   +/-   ##
=======================================
  Coverage   92.82%   92.82%           
=======================================
  Files          95       95           
  Lines       11067    11069    +2     
=======================================
+ Hits        10273    10275    +2     
  Misses        794      794           
Flag Coverage Δ
linux 92.59% <100.00%> (+<0.01%) ⬆️
pypy 88.17% <100.00%> (+<0.01%) ⬆️
windows 92.38% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
astroid/nodes/node_ng.py 93.11% <100.00%> (+0.04%) ⬆️

@ostr00000
Copy link
Contributor Author

I am closing this, since code with inferred()[0] should be refactored another way (Ideally we would always check all results of infer() or use safe_infer to make sure we are using the "full" result and not [0] or [-1]).
See #2065 for more details.

@ostr00000 ostr00000 closed this Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve inferred interface
1 participant