-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Use "typing.List" as an annotation #10004
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
Conversation
Ic onsider that if `typing.List` is going to be imported, it must be used as an annotation, not to be commented. Or maybe using `typing.Sequence` could be better. If am wrong with something, please tell me.
This is the NEWS document for this branch.
|
Tell me if I did something wrong please 😄 . Thanks. |
|
The comments are Python 2 style type annotations. As we no longer support Python 2, we can (and should) move to proper annotations, but I think we'll probably do that as a larger exercise, rather than just changing individual definitions. |
|
Ok, thank you. On my commit, I didn't moved the comments, because I thought both where necessary. If I can do something else, tell me please. |
|
Sorry, I have a question: Is this PR available to be applied, or it must be replaced by another one? Anyway, I would like to collaborate on this topic. If you want, I can work on it on my fork. |
|
I wouldn't mind merging this on its own if you remove the type comment. |
|
Ok. I will try it. |
After adding "typing.List" as Python 3 annotations, remove the old annotations (commentaries).
|
Done. I replaced the type commentaries from |
Remove the item marker. Co-authored-by: Tzu-ping Chung <[email protected]>
|
Ok. Do I have to improve anything else? Tell me, please. |
Fix the code blocks Co-authored-by: Tzu-ping Chung <[email protected]>
uranusjr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI to pass.
|
Ok. Thank you very much. |
|
I can't merge. If you want to merge, you can do it. Thanks 😄 . |
This job started with my PR pypa#10004. When I started to replace the type commentaries into proper annotations. For this pull request, I'll take `pip/_internal/distributions`.
This is something that I found on
tools/tox_pip.py:I consider that if
typing.Listis going to be imported, it must be used as an annotation, not to be commented. Or maybe usingtyping.Sequencecould be better. If am wrong with something, please tell me.(I agree to the PSF code of conduct).