-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
[3.10] bpo-45680: Clarify documentation on GenericAlias
objects (GH-29335)
#30688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.10] bpo-45680: Clarify documentation on GenericAlias
objects (GH-29335)
#30688
Conversation
…H-29335) The documentation on ``GenericAlias`` objects implies at multiple points that only container classes can define ``__class_getitem__``. This is misleading. This PR proposes a rewrite of the documentation to clarify that non-container classes can define ``__class_getitem__``, and to clarify what it means when a non-container class is parameterized. See also: initial discussion of issues with this piece of documentation in pythonGH-29308, and previous BPO issue [42280](https://bugs.python.org/issue42280). Also improved references in glossary and typing docs. Fixed some links. Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 0eae9a2) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a failure ❌ . |
@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ . |
@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ . |
Sorry, I can't merge this PR. Reason: |
@miss-islington: Status check is done, and it's a success ✅ . |
@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ . |
The documentation on
GenericAlias
objects implies at multiple points thatonly container classes can define
__class_getitem__
. This is misleading.This PR proposes a rewrite of the documentation to clarify that non-container
classes can define
__class_getitem__
, and to clarify what it means when anon-container class is parameterized.
See also: initial discussion of issues with this piece of documentation in
GH-29308, and previous BPO issue 42280.
Also improved references in glossary and typing docs. Fixed some links.
Co-authored-by: Erlend Egeberg Aasland erlend.aasland@innova.no
Co-authored-by: Ken Jin 28750310+Fidget-Spinner@users.noreply.github.com
(cherry picked from commit 0eae9a2)
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com
https://bugs.python.org/issue45680
Automerge-Triggered-By: GH:Fidget-Spinner