Skip to content

Warn about unannotated functions containing annotations #4166

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

Closed
gvanrossum opened this issue Oct 26, 2017 · 2 comments
Closed

Warn about unannotated functions containing annotations #4166

gvanrossum opened this issue Oct 26, 2017 · 2 comments

Comments

@gvanrossum
Copy link
Member

I found some examples (https://bugs.python.org/issue28936) of functions that have no signature annotations but contain local variable annotations. These are currently ignored. I think we should actually warn whenever an annotation (either a type comment or PEP 526 style) occurs in an unannotated function, since it likely reflects some kind of misunderstanding about annotations.

Or at the very least we should have an option to warn about such things.

(IIRC we recently doused a similar source of confusion, but I can't recall the details.)

@ilevkivskyi
Copy link
Member

Isn't this a duplicate of #3948? Or am I missing something?

@gvanrossum
Copy link
Member Author

How quickly we forget. :-)

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

No branches or pull requests

2 participants