Documentation
PEP-585 introduced native generic support several years ago by adding the __class_getitem__ method. But all docstrings for C-implemented __class_getitem__ methods are just "See PEP 585", and the online documentation has nothing to say about this.
When a class is generic, we should tell users what it is generic over, so that those who wish to use types can understand what type parameters to use.
In the online documentation, any generic class should have a note like "This class is generic [link to docs about generics] and takes N type parameters, representing respectively ...".
The docstring for the __class_getitem__ method should similarly outline what the type parameters are.
Linked PRs
Documentation
PEP-585 introduced native generic support several years ago by adding the
__class_getitem__method. But all docstrings for C-implemented__class_getitem__methods are just "See PEP 585", and the online documentation has nothing to say about this.When a class is generic, we should tell users what it is generic over, so that those who wish to use types can understand what type parameters to use.
In the online documentation, any generic class should have a note like "This class is generic [link to docs about generics] and takes N type parameters, representing respectively ...".
The docstring for the
__class_getitem__method should similarly outline what the type parameters are.Linked PRs