Skip to content

[3.10] bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)#27897

Merged
miss-islington merged 2 commits into
python:3.10from
miss-islington:backport-dabb6e8-3.10
Aug 22, 2021
Merged

[3.10] bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)#27897
miss-islington merged 2 commits into
python:3.10from
miss-islington:backport-dabb6e8-3.10

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Aug 22, 2021

  • 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

https://bugs.python.org/issue44957

* 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>
@miss-islington
Copy link
Copy Markdown
Contributor Author

@srittau and @ambv: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Copy Markdown
Contributor Author

@srittau and @ambv: Status check is done, and it's a success ❌ .

@ambv
Copy link
Copy Markdown
Contributor

ambv commented Aug 22, 2021

Copy link
Copy Markdown
Contributor

@ambv ambv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc-only change.

@miss-islington miss-islington merged commit 57b321c into python:3.10 Aug 22, 2021
@miss-islington miss-islington deleted the backport-dabb6e8-3.10 branch August 22, 2021 20:04
@miss-islington
Copy link
Copy Markdown
Contributor Author

@srittau and @ambv: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants