]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)
authorSebastian Rittau <srittau@rittau.biz>
Sun, 22 Aug 2021 18:45:01 +0000 (20:45 +0200)
committerGitHub <noreply@github.com>
Sun, 22 Aug 2021 18:45:01 +0000 (20:45 +0200)
commitdabb6e8ddd7626266184ba022bcb76f74196248f
tree3bb7fa8317344550540bca7ee61687f5dee4d08a
parentd5dbe8bca792350f4997c027535e0ca498abd1bb
bpo-44957: Promote PEP 604 syntax in typing docs (GH-27833)

* 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>
Doc/library/typing.rst
Misc/NEWS.d/next/Documentation/2021-08-19-15-53-08.bpo-44957.imqrh3.rst [new file with mode: 0644]