-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Use TypeAlias
where possible for type aliases
#7630
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
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
Looks good, thanks for doing all this!
LPWIN32_FIND_DATAW = pointer[WIN32_FIND_DATAW] | ||
PWORD = pointer[WORD] | ||
LPWORD = pointer[WORD] | ||
PBOOL: TypeAlias = pointer[BOOL] |
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.
This looks a bit odd but seems like they're indeed intended as aliases.
|
||
_list = list # conflicts with a method named "list" | ||
_T = TypeVar("_T") |
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.
good catch, though maybe we should do from builtins import list as _list
instead
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.
Done in #7634!
This PR was accomplished using the following steps:
TypeAlias
that the script missed, remove a few where the script was overzealous.Script I used for step one: