Title: Add `__class_getitem__` support to `memoryview` · Issue #126012 · python/cpython · GitHub
Open Graph Title: Add `__class_getitem__` support to `memoryview` · Issue #126012 · python/cpython
X Title: Add `__class_getitem__` support to `memoryview` · Issue #126012 · python/cpython
Description: Feature or enhancement Proposal: memoryview was made generic in typeshed in python/typeshed#12247. Mypy recently received a report (python/mypy#18053) due to it not being subscriptable at runtime: >>> memoryview[int] Traceback (most rece...
Open Graph Description: Feature or enhancement Proposal: memoryview was made generic in typeshed in python/typeshed#12247. Mypy recently received a report (python/mypy#18053) due to it not being subscriptable at runtime: ...
X Description: Feature or enhancement Proposal: memoryview was made generic in typeshed in python/typeshed#12247. Mypy recently received a report (python/mypy#18053) due to it not being subscriptable at runtime: ...
Opengraph URL: https://github.com/python/cpython/issues/126012
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `__class_getitem__` support to `memoryview`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\n`memoryview` was made generic in typeshed in https://github.com/python/typeshed/pull/12247. Mypy recently received a report (https://github.com/python/mypy/issues/18053) due to it not being subscriptable at runtime:\n```python\n>>> memoryview[int]\nTraceback (most recent call last):\n File \"\u003cpython-input-0>\", line 1, in \u003cmodule>\n memoryview[int]\n ~~~~~~~~~~^^^^^\nTypeError: type 'memoryview' is not subscriptable\n```\nIt seems that `memoryview` should be made subscriptable at runtime, like other standard library classes that are generic in typeshed.\n\nHappy to make a PR if there's agreement that this should be added.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-126013\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/brianschubert","@type":"Person","name":"brianschubert"},"datePublished":"2024-10-26T17:16:40Z","url":"https://github.com/python/cpython/issues/126012"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:47a81f78-01d2-759a-e057-ae6ebeb686bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B32A:1CF166:261F23F:33F09EF:6B003DAF |
| html-safe-nonce | d397c5322f36aaba98209262e5afb7e915aa81b00b6c1fdedefeb8875ab6bc68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzJBOjFDRjE2NjoyNjFGMjNGOjMzRjA5RUY6NkIwMDNEQUYiLCJ2aXNpdG9yX2lkIjoiMzExNjU3MzAwMzU4MDcxODUxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b95741f252bc3253ab845468dbae61c0f627d1a2b0597bc9c6c55d8b0891c34e |
| hovercard-subject-tag | issue:2616012111 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/126012/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e801b8550ee0307974b105fc158f2a0da25b6852583f1090d96724e2120073ed/python/cpython/issues/126012 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e801b8550ee0307974b105fc158f2a0da25b6852583f1090d96724e2120073ed/python/cpython/issues/126012 |
| og:image:alt | Feature or enhancement Proposal: memoryview was made generic in typeshed in python/typeshed#12247. Mypy recently received a report (python/mypy#18053) due to it not being subscriptable at runtime: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brianschubert |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width