You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update typing module documentation based on PEP 585 #84991
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-10-31.17:37:43.363>created_at=<Date2020-05-29.12:28:33.397>labels= ['type-bug', '3.9', '3.10', 'docs']
title='Update typing module documentation based on PEP 585'updated_at=<Date2020-10-31.17:37:43.363>user='https://github.com/matusvalo'
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?
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?
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.
Activity
matusvalo commentedon May 29, 2020
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?
gvanrossum commentedon Jun 21, 2020
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?
gvanrossum commentedon Jul 25, 2020
Alternatively, we at least need a section of documentation for things like
list[int]anddict[str, float].Fidget-Spinner commentedon Oct 10, 2020
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.
gvanrossum commentedon Oct 10, 2020
Yes, let’s document __args__ and __origin__.
Fidget-Spinner commentedon Oct 19, 2020
The PR should be ready for review now. Thanks for your patience.
Fidget-Spinner commentedon Oct 31, 2020
IMO, this can now be closed.
Most code examples in typing were changed to builtin generics:
d9ab95f
7f54e56
Docs for PEP-585's GenericAlias was added:
4173320
Dict, List, and friends were also all marked as deprecated in 3.9.