astroid
astroid copied to clipboard
Enforce inference strong updates when possible
Steps to reproduce
Run an inference over the following example:
options = []
if len(sys.argv) > 1:
options = [["Woof!"]]
else:
options = [["Barf!"]]
Current behavior
When we try to infer options, we get three results: an empty list and the two values from the if statement.
Expected behavior
We should only infer two lists here from the if statement, since the first empty list is lost after the if statement
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output
All versions.