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

Don't emit unreachable warning for empty generator functions #4699

Merged
merged 1 commit into from Jul 10, 2021

Conversation

cdce8p
Copy link
Member

@cdce8p cdce8p commented Jul 10, 2021

Description

The unreachable code warning should not be emitted for empty generator functions.

def func():
    return
    yield

Type of Changes

Type
βœ“ πŸ› Bug fix

Related Issue

Closes #4698

@cdce8p cdce8p added this to the 2.9.4 milestone Jul 10, 2021
@coveralls
Copy link

coveralls commented Jul 10, 2021

Coverage Status

Coverage increased (+0.002%) to 92.051% when pulling 9c05623 on cdce8p:fix-unreachable-empty-generator into 821e4d1 on PyCQA:main.

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.

Neat ! I did not know about empty generators.

@cdce8p cdce8p force-pushed the fix-unreachable-empty-generator branch from 6a6d58a to 9c05623 Compare July 10, 2021 19:38
@cdce8p cdce8p merged commit 73089b5 into pylint-dev:main Jul 10, 2021
@cdce8p cdce8p deleted the fix-unreachable-empty-generator branch July 10, 2021 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False-positive unreachable code for empty generator
3 participants