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

E1111 False Positive With Generators #2400

Closed
ryannathans opened this issue Aug 10, 2018 · 3 comments · Fixed by gita/BhagavadGita#137, rhaamo/ahrl#13, rkpop/twitter-bot#8 or ChrisRBe/PP-P2P-Parser#53 · May be fixed by Resurfed/timer-api#22
Closed
Assignees
Labels

Comments

@ryannathans
Copy link

ryannathans commented Aug 10, 2018

Steps to reproduce

class Test:

	def __init__(self):
		self.generator = self._make_gen()

	def _make_gen(self):
		a = yield
		while True:
			print(a)
			a = yield

Current behavior

Highlights self.generator = self._make_gen() with E1111

Expected behavior

No E1111 false positive on this line

pylint --version output

__main__.py 2.0.1
astroid 2.0.1
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 17:26:49) [MSC v.1900 32 bit (Intel)]
@PCManticore
Copy link
Contributor

Thanks, I can reproduce this issue!

@PCManticore PCManticore self-assigned this Aug 10, 2018
@ryannathans
Copy link
Author

Probably because the yield isn't at the start of the line

@PCManticore
Copy link
Contributor

This is fixed in the linked commit, I'm doing a bug fix release for astroid now. Should be available in ~10 minutes.

clrpackages pushed a commit to clearlinux-pkgs/astroid that referenced this issue Aug 11, 2018
…ements in their values

commit 5b5cd7acbecaa9b587b07de27a3334a2ec4f2a79
Author: Claudiu Popa <pcmanticore@gmail.com>
Date:   Fri Aug 10 09:07:25 2018 +0200

    Prepare 2.0.4

commit 3f7c4bc2541cfe4c069bc5c02d981f91f7d39ba2
Author: Claudiu Popa <pcmanticore@gmail.com>
Date:   Fri Aug 10 09:04:56 2018 +0200

    Make sure that assign nodes can find ``yield`` statements in their values

    Close pylint-dev/pylint#2400

What's New in astroid 2.0.4?
============================
Release Date: 2018-08-10

   * Make sure that assign nodes can find ``yield`` statements in their values

     Close pylint-dev/pylint#2400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment