-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Use builtin generics and PEP 604 for type annotations wherever possible #13427
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
@@ -20,7 +20,7 @@ def apply_all( | |||
directory: str, | |||
extension: str, | |||
to_extension: str = "", | |||
exclude: Tuple[str] = ("",), | |||
exclude: tuple[str] = ("",), |
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.
Not related to your change but pretty sure this should be tuple[str, ...]
.
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.
That looks highly plausible :) I'd rather not make that change in this PR, though
This comment has been minimized.
This comment has been minimized.
f9bebbb
to
c70baac
Compare
This comment has been minimized.
This comment has been minimized.
I prefer changing to this, it is less friction needing to import, and if we don't change the whole codebase over, using it in new code will be a style clash |
c70baac
to
8f908b1
Compare
This comment has been minimized.
This comment has been minimized.
8f908b1
to
500dc0a
Compare
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Thanks everybody! 🥳 |
I'm not sure if this is something we want to do or not -- but if it is something we want to do, this is what it looks like!
This PR was made using the following script, which relies on
com2ann
,pyupgrade
,autoflake
,pycln
,black
andisort
all being installed: