-
Notifications
You must be signed in to change notification settings - Fork 258
Need a solution for long signatures in Python 2 #186
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
Would it be valid to annotate just a few arguments? Only the return type? |
Yes to both. The proposed semantics of In fact it should also be possible to just annotate some arguments and not give the signature at all -- that's like leaving the "-> blah" out from the PY3 form. However you shouldn't annotate individual arguments and have explicit types in the latter; this is invalid:
|
Fixed in the PEP by https://hg.python.org/peps/rev/81c177edf735. Implemented in PyCharm (but not yet in mypy). |
Also a6e763a in the typing repo. |
See python/mypy#1102. I propose to go with this form:
(We'll keep the other form too, since it is fine for short signatures.)
The text was updated successfully, but these errors were encountered: