GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.9] bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335) by Fidget-Spinner · Pull Request #30689 · python/cpython

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Jan 19, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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]
Co-Authored-By: Alex Waygood [email protected]

(cherry picked from commit 0eae9a2)

https://bugs.python.org/issue45680

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fidget-Spinner Erlend Egeberg Aasland @AlexWaygood
bpo-45680: Clarify documentation on GenericAlias objects (pythonG…
8766418
…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]>
Co-Authored-By: Alex Waygood <[email protected]>
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jan 19, 2022
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Jan 19, 2022
@bedevere-bot bedevere-bot mentioned this pull request Jan 19, 2022
bpo-45680: Clarify documentation on GenericAlias objects #29335
Merged
@bedevere-bot bedevere-bot added skip news awaiting core review labels Jan 19, 2022
@Fidget-Spinner
fix rST title levels
a131023
@Fidget-Spinner
Fidget-Spinner requested a review from AlexWaygood January 19, 2022 15:48
AlexWaygood
AlexWaygood approved these changes Jan 19, 2022
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fidget-Spinner
Fidget-Spinner merged commit 0064516 into python:3.9 Jan 19, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Jan 19, 2022
@Fidget-Spinner
Fidget-Spinner deleted the backport_45680 branch January 19, 2022 16:01
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
@Fidget-Spinner Erlend Egeberg Aasland
@AlexWaygood @hello-adam
[3.9] bpo-45680: Clarify documentation on GenericAlias objects (p…
82a1542
…ythonGH-29335) (pythonGH-30689)

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.

(cherry picked from commit 0eae9a2)

Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Co-Authored-By: Ken Jin <[email protected]>
Co-Authored-By: Alex Waygood <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Fidget-Spinner @AlexWaygood @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.