[3.10] bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)#27897
Merged
miss-islington merged 2 commits intoAug 22, 2021
Conversation
* Use "X | Y" instead of "Union" where it makes sense. * Mention that "X | Y" is equivalent to "Union[X, Y]" in Union section. * Remove "Optional[X]" as shorthand for "Union[X, None]" as the new shorthand is now "X | None". * Mention that "Optional[X]" can be written as "X | None" in section about "Optional". Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit dabb6e8) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Contributor
Author
Contributor
Author
Contributor
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

shorthand is now "X | None".
about "Optional".
Co-authored-by: Ken Jin 28750310+Fidget-Spinner@users.noreply.github.com
(cherry picked from commit dabb6e8)
Co-authored-by: Sebastian Rittau srittau@rittau.biz
https://bugs.python.org/issue44957