This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Update typing module documentation based on PEP 585
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.10, Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: DahlitzFlorian, Matúš Valo, docs@python, gvanrossum, kj, levkivskyi
Priority: normal Keywords: patch

Created on 2020-05-29 12:28 by Matúš Valo, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22615 kj, 2020-10-10 04:18
Messages (7)
msg370306 - (view) Author: Matúš Valo (Matúš Valo) * Date: 2020-05-29 12:28
In documentation of typing module there is no mention of new possibilities based on PEP 585. Moreover, should be old constructs like  List, Dict,... marked as deprecated?
msg372008 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-06-21 17:41
I don't think we should deprecate List etc. (PEP 585 specifically punts on the topic) but it's good to start mentioning list[t] etc. in the docs. Do you want to volunteer to write some docs?
msg374288 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-07-25 21:58
Alternatively, we at least need a section of documentation for things like `list[int]` and `dict[str, float]`.
msg378362 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2020-10-10 04:18
I've created a PR 22615 which partly addresses the documentation for GenericAlias in stdtypes.

I have a side question: should __args__, and __origin__ be documented somewhere as well? I noticed it has no documentation even though it's used to check generics. At the same time, I'm not fully sure that it's a standard Python thing rather than a CPython implementation detail.
msg378367 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-10-10 06:36
Yes, let’s document __args__ and __origin__.
msg378921 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2020-10-19 04:10
The PR should be ready for review now. Thanks for your patience.
msg380079 - (view) Author: Ken Jin (kj) * (Python committer) Date: 2020-10-31 16:59
IMO, this can now be closed.

Most code examples in typing were changed to builtin generics:

Docs for PEP 585's GenericAlias was added:

Dict, List, and friends were also all marked as deprecated in 3.9.
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84991
2020-10-31 17:37:43gvanrossumsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-10-31 16:59:23kjsetmessages: + msg380079
2020-10-19 04:10:31kjsetmessages: + msg378921
2020-10-10 06:36:04gvanrossumsetmessages: + msg378367
2020-10-10 04:18:09kjsetnosy: + kj
messages: + msg378362
pull_requests: + pull_request21605

keywords: + patch
stage: patch review
2020-07-25 21:58:08gvanrossumsetmessages: + msg374288
2020-06-21 17:41:31gvanrossumsetmessages: + msg372008
2020-05-29 15:05:44DahlitzFloriansetnosy: + DahlitzFlorian
2020-05-29 12:28:33Matúš Valocreate