]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-39491: Merge PEP 593 (typing.Annotated) support (#18260)
authorJakub Stasiak <jakub@stasiak.at>
Wed, 5 Feb 2020 01:10:19 +0000 (02:10 +0100)
committerGitHub <noreply@github.com>
Wed, 5 Feb 2020 01:10:19 +0000 (17:10 -0800)
commitcf5b109dbb39bcff1bc5b5d22036866d11de971b
treeb440ac6cb94a42445ea56fa0bdfd144545bc0e71
parent89ae20b30e4543f379ee647c965eb46200556496
bpo-39491: Merge PEP 593 (typing.Annotated) support (#18260)

* bpo-39491: Merge PEP 593 (typing.Annotated) support

PEP 593 has been accepted some time ago. I got a green light for merging
this from Till, so I went ahead and combined the code contributed to
typing_extensions[1] and the documentation from the PEP 593 text[2].

My changes were limited to:

* removing code designed for typing_extensions to run on older Python
  versions
* removing some irrelevant parts of the PEP text when copying it over as
  documentation and otherwise changing few small bits to better serve
  the purpose
* changing the get_type_hints signature to match reality (parameter
  names)

I wasn't entirely sure how to go about crediting the authors but I used
my best judgment, let me know if something needs changing in this
regard.

[1] https://github.com/python/typing/blob/8280de241fd8c8afe727c7860254b753e383b360/typing_extensions/src_py3/typing_extensions.py
[2] https://github.com/python/peps/blob/17710b879882454d55f82c2d44596e8e9f8e4bff/pep-0593.rst
Doc/library/typing.rst
Doc/whatsnew/3.9.rst
Lib/test/test_typing.py
Lib/typing.py
Misc/NEWS.d/next/Library/2020-01-29-22-47-12.bpo-39491.tdl17b.rst [new file with mode: 0644]