Skip to content

Conversation

doranid
Copy link
Contributor

@doranid doranid commented Jul 10, 2021

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

This fixes issue #1090. I'm not sure if this is the right way to fix it, the old problem was that the yield values were inferred in a later context. Because a generator in Python stores a specific context, I thought that it should also be reflected in astroid's code. I'd be glad to get feedback.

Thanks!

Type of Changes

Type
🐛 Bug fix

Related Issue

If this PR fixes a particular issue, use the following to automatically close that issue
once this PR gets merged:

Closes #1090

@doranid doranid requested a review from Pierre-Sassoulas July 12, 2021 18:33
@Pierre-Sassoulas Pierre-Sassoulas added the pylint-tested PRs that don't cause major regressions with pylint label Jul 12, 2021
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.

LGTM. I tested it in pylint and there's no regression. I does not fix #1008, which probably means it was not a duplicate even if it looks similar.

@Pierre-Sassoulas
Copy link
Member

Thank you again for thinking about and fixing this circular import issue :)

@Pierre-Sassoulas Pierre-Sassoulas merged commit 820a755 into pylint-dev:main Jul 12, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.6.3 milestone Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 🪳 pylint-tested PRs that don't cause major regressions with pylint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yield self is inferred to be of a mistaken type

2 participants