Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython · GitHub
Open Graph Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython
X Title: bpo-45680: Clarify documentation on ``GenericAlias`` objects by AlexWaygood · Pull Request #29335 · python/cpython
Description: 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. The PR also proposes some changes to the list of standard library classes that define __class_getitem__. This PR proposes adding several classes to the list, to make it somewhat more complete. However, more importantly, it attempts to clarify that the list is not intended to be an exhaustive enumeration of every single standard-library class that defined __class_getitem__. See also: initial discussion of issues with this piece of documentation in #29308, and previous BPO issue 42280. https://bugs.python.org/issue45680
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/python/cpython/pull/29335
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:dcea388f-7795-d279-aed9-fa7c6ea3bf21 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | D67C:3346BC:B4091D:F51183:6969E660 |
| html-safe-nonce | e00be4347f074ff18a633ec3a3430022cb29c9a79f2972b19a0b864363dd28f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjdDOjMzNDZCQzpCNDA5MUQ6RjUxMTgzOjY5NjlFNjYwIiwidmlzaXRvcl9pZCI6IjU1MDc1NDA4NTU4MjUyMjk0MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e1fe571f3df2fe0fed63865e2e59f367d45422e6e428e2e96c4d0c6ab30c0d9f |
| hovercard-subject-tag | pull_request:769793914 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/29335/checks |
| twitter:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/66076021?s=400&v=4 |
| og:image:alt | 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... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width