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

Fix inference of self in a list or tuple within bin. ops. #1360

Merged
merged 2 commits into from
Feb 8, 2022

Conversation

DanielNoord
Copy link
Collaborator

Steps

  • For new features or bug fixes, add a ChangeLog entry describing what your PR does.
  • Write a good description on what the PR does.

Description

Will close this issue pylint-dev/pylint#4826.

The main change is that the inference is no longer bound to the instance node on which the binary operation is performed.
Without this change it kept inferring a in print(a) as being as list because that was the bound node as set by the binary operation inference method.

I've also added typing which should help troubleshoot future problems and explained what this method is actually referring to.

Type of Changes

Type
🐛 Bug fix

Related Issue

@DanielNoord DanielNoord added this to the 2.10.0 milestone Jan 18, 2022
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very elegant one line fix !

@DanielNoord
Copy link
Collaborator Author

Tests in pylint have been added as well!

@DanielNoord DanielNoord merged commit e9d054c into pylint-dev:main Feb 8, 2022
@DanielNoord DanielNoord deleted the boundnode branch February 8, 2022 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants