-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Invalid definition of Tuple in return reports on a confusing line number #3177
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
Comments
This may be because mypy's parser considers decorator a part of the function definition and assigns the function type the first line of the function definition. |
Yes, I assumed that that was the case but for someone like me that's new to typing in Python and using mypy to verify it, it was confusing. Now that I now that you're supposed to do On a related note, it is also confusing that you can't using the normal tuple syntax for typing. |
Yes, that's why, and I agree it would be better to pin-point errors to the specific line where they occur.
Presuming you're referring to the idea of writing |
I'm going to take a stab at this issue. |
Here's an example:
And here's the output (I'd expect it to say Line #3):
The text was updated successfully, but these errors were encountered: