Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jan 19, 2022

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
GH-29308, and previous BPO issue 42280.

Also improved references in glossary and typing docs. Fixed some links.

Co-authored-by: Erlend Egeberg Aasland [email protected]
Co-authored-by: Ken Jin [email protected]
(cherry picked from commit 0eae9a2)

Co-authored-by: Alex Waygood [email protected]

https://bugs.python.org/issue45680

Automerge-Triggered-By: GH:Fidget-Spinner

…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 <[email protected]>
Co-authored-by: Ken Jin <[email protected]>
(cherry picked from commit 0eae9a2)

Co-authored-by: Alex Waygood <[email protected]>
@miss-islington
Copy link
Contributor Author

@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a failure ❌ .

@miss-islington
Copy link
Contributor Author

@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

Sorry, I can't merge this PR. Reason: Head branch was modified. Review and try the merge again..

@miss-islington
Copy link
Contributor Author

@miss-islington: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 24d0b33 into python:3.10 Jan 19, 2022
@miss-islington miss-islington deleted the backport-0eae9a2-3.10 branch January 19, 2022 15:24
@miss-islington
Copy link
Contributor Author

@AlexWaygood and @Fidget-Spinner: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants