Skip to content

Comments

conformance: allow emitting an error on missing return with Any annotation#2188

Open
JelleZijlstra wants to merge 2 commits intopython:mainfrom
JelleZijlstra:no-return-any
Open

conformance: allow emitting an error on missing return with Any annotation#2188
JelleZijlstra wants to merge 2 commits intopython:mainfrom
JelleZijlstra:no-return-any

Conversation

@JelleZijlstra
Copy link
Member

Pycroscope produces an error on the existing open() function in this file
because it is annotated as returning Any, but doesn't have a return statement.
There's some existing discussion of this case in python/mypy#10297
showing that it is intentional for mypy to not error here, but I don't think
we need to prohibit type checkers from emitting an error in this case
if they choose.

…ation

Pycroscope produces an error on the existing open() function in this file
because it is annotated as returning Any, but doesn't have a return statement.
There's some existing discussion of this case in python/mypy#10297
showing that it is intentional for mypy to not error here, but I don't think
we need to prohibit type checkers from emitting an error in this case
if they choose.
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I agree that whether or not a type checker emits a lint for this pattern should have no bearing on whether or not this test passes, since this test is trying to test something wholly unrelated to that question

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.

2 participants