-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Big diff: Use new "|" union syntax #5872
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thanks, I checked a couple of file and this looks great.
Will leave this open for a while longer in case someone has an objection.
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.
Thanks, I think it's a good idea to have the stubs as modern as can be, as they are likely to be used as examples for other stub creators.
I think I'll merge this once CI passes. Waiting longer causes conflicts that I have to fix manually, and that's error-prone and hard to review as a part of a huge PR. |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
@Akuli Will this also work on Python 3.9 because as far as I know this new syntax is being introduced in Python 3.10 ? |
The syntax works in |
@Akuli Ah, thanks! |
Done with quick and dirty scripts:
main script
Import cleaner (can mess up comments, needs manual checking)
Files left untouched (e.g. because scripts did something weird):
@python2
stubs (stdlib and third party)stubs/protobuf/google/
stdlib/_ast.pyi
stdlib/_thread.pyi
stdlib/ast.pyi
stdlib/asyncio/tasks.pyi
stdlib/configparser.pyi
stdlib/ctypes/__init__.pyi
stdlib/email/_header_value_parser.pyi
stdlib/os/__init__.pyi
stdlib/pickle.pyi
stdlib/types.pyi
stdlib/zoneinfo/__init__.pyi
stubs/Jinja2/jinja2/nodes.pyi
stubs/click/click/core.pyi
stubs/requests/requests/sessions.pyi
stubs/six/six/__init__.pyi
stubs/typed-ast/typed_ast/ast27.pyi
stubs/typed-ast/typed_ast/ast3.pyi