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

What to do if a stub has an incorrect bool return for __exit__ #7666

Open
JukkaL opened this issue Oct 9, 2019 · 0 comments
Open

What to do if a stub has an incorrect bool return for __exit__ #7666

JukkaL opened this issue Oct 9, 2019 · 0 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Oct 9, 2019

If the line after a with statement becomes reachable because a stub has __exit__ annotated to return bool, even though the actual runtime return value is always False, this can result in confusing missing return statement errors.

One way to deal with this would be to detect this and add a note saying that the __exit__ return type may be causing a spurious error.

Follow-up to #7655. See #7577 for context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants