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

Compare node inferring #846

Closed
usagitoneko97 opened this issue Oct 21, 2020 · 1 comment · Fixed by #979
Closed

Compare node inferring #846

usagitoneko97 opened this issue Oct 21, 2020 · 1 comment · Fixed by #979
Labels
Enhancement ✨ Improvement to a component
Milestone

Comments

@usagitoneko97
Copy link

This might be obvious, but I can't find any issue on compare node inferring. I maybe wrong here. but I thought that it will be a straight forward implementation, similar to binop implementation. Perhaps because of multiple comparators complicate things?

Steps to reproduce

from astroid.builder import parse
module = parse(
"""
x = 1 > 2
"""
)
inferred = next(module["x"].infer())
print(inferred)

Current behavior

Uninferable

Expected behavior

False const

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

2.5.0

@hippo91
Copy link
Contributor

hippo91 commented Oct 23, 2020

@usagitoneko97 it is indeed surprising. Maybe @PCManticore or @AWhetter will have an answer?

@AWhetter AWhetter added the Enhancement ✨ Improvement to a component label Oct 23, 2020
nelfin added a commit to nelfin/astroid that referenced this issue Apr 29, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
nelfin added a commit to nelfin/astroid that referenced this issue Apr 29, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
nelfin added a commit to nelfin/astroid that referenced this issue Aug 18, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
nelfin added a commit to nelfin/astroid that referenced this issue Aug 18, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
nelfin added a commit to nelfin/astroid that referenced this issue Aug 27, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
nelfin added a commit to nelfin/astroid that referenced this issue Aug 27, 2021
Ref pylint-dev#846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.
Pierre-Sassoulas added a commit that referenced this issue Sep 14, 2021
* Add inference for Compare nodes

Ref #846.

Identity checks are currently Uninferable as there is no sensible way to
infer that two Instances refer to the same object without accurately
modelling control flow.

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.8.0 milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants