Skip to content

[doc] bpo-45680: Disambiguate __getitem__ and __class_getitem__ in the data model.#29389

Merged
ambv merged 11 commits intopython:mainfrom
AlexWaygood:class_getitem-docs
Nov 18, 2021
Merged

[doc] bpo-45680: Disambiguate __getitem__ and __class_getitem__ in the data model.#29389
ambv merged 11 commits intopython:mainfrom
AlexWaygood:class_getitem-docs

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Nov 3, 2021

The documentation explaining Python's data model does not adequately explain
the differences between __getitem__ and __class_getitem__, nor does it
explain when each is called. There is an attempt at explaining
__class_getitem__ in the documentation for GenericAlias objects, but
this does not give sufficient clarity into how the method works. Moreover, it
is the wrong place for that information to be found; the explanation of
__class_getitem__ should be in the documentation explaining the data model.

This PR has been split off from #29335.

https://bugs.python.org/issue45680

Loading
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.

6 participants