]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Jan 2022 15:24:14 +0000 (07:24 -0800)
committerGitHub <noreply@github.com>
Wed, 19 Jan 2022 15:24:14 +0000 (07:24 -0800)
commit24d0b331e81b4e4af8dd4c1b66ea7159c1fdabc5
tree7be193d4812643652c88bd0885316679a8c17be6
parent0861a50bd434d1f3e12fe7122e37356f1fce93dc
[3.10] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) (GH-30688)

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 <erlend.aasland@innova.no>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 0eae9a2a2db6cc5a72535f61bb988cc417011640)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Automerge-Triggered-By: GH:Fidget-Spinner
Doc/library/stdtypes.rst