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

Should infer more values for == __name__ (possibly other dunders) #2071

Closed
jacobtylerwalls opened this issue Mar 30, 2023 · 0 comments · Fixed by #2345 or #2390
Closed

Should infer more values for == __name__ (possibly other dunders) #2071

jacobtylerwalls opened this issue Mar 30, 2023 · 0 comments · Fixed by #2345 or #2390
Assignees
Milestone

Comments

@jacobtylerwalls
Copy link
Member

Steps to reproduce

>>> n = extract_node("if __name__ == '__main__':  ...")
>>> n.test.inferred()
[<Const.bool l.None at 0x10baadf90>]
>>> n.test.inferred()[0]
<Const.bool l.None at 0x10c71eb50>
>>> n.test.inferred()[0].value
False

Current behavior

1 inferred value

Expected behavior

2 inferred values (True, False)

python -c "from astroid import __pkginfo__; print(__pkginfo__.version)" output

2.16.0dev0

More info

Inspired by pylint-dev/pylint#8167

@jacobtylerwalls jacobtylerwalls changed the title Should infer more values for __name__ (possibly other dunders) Should infer more values for == __name__ (possibly other dunders) Mar 30, 2023
@jacobtylerwalls jacobtylerwalls self-assigned this Dec 12, 2023
@jacobtylerwalls jacobtylerwalls added this to the 3.1.0 milestone Dec 12, 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
1 participant