-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Documents explicit type aliases #11800
Conversation
docs/source/kinds_of_types.rst
Outdated
|
||
AliasType: TypeAlias = Union[list[dict[tuple[int, str], set[int]]], tuple[str, list[str]]] | ||
|
||
Explicit type aliases solves the ambiguness and improves readability. |
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.
Explicit type aliases solves the ambiguness and improves readability. | |
Explicit type aliases are unambiguous and improve readability. |
"ambiguess" is not a word :)
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! Sometimes I make quite funny typos 🙂
Co-authored-by: Jelle Zijlstra <[email protected]>
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, might also be worth leaving a note in https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
@hauntsaninja done! |
Refs https://www.python.org/dev/peps/pep-0613/ Co-authored-by: Jelle Zijlstra <[email protected]>
Refs https://www.python.org/dev/peps/pep-0613/ Co-authored-by: Jelle Zijlstra <[email protected]>
Refs https://www.python.org/dev/peps/pep-0613/
I hope that I am correct with mypy's version number 🙂