Title: Remove `_ProxyFile.__class_getitem__` · Issue #140808 · python/cpython · GitHub
Open Graph Title: Remove `_ProxyFile.__class_getitem__` · Issue #140808 · python/cpython
X Title: Remove `_ProxyFile.__class_getitem__` · Issue #140808 · python/cpython
Description: Feature or enhancement Proposal: #19425 made the internal file wrapper mailbox._ProxyFile generic, probably because it was generic over AnyStr in typeshed. (Unchanged since mailbox.pyi was added in python/typeshed#3427. There was no disc...
Open Graph Description: Feature or enhancement Proposal: #19425 made the internal file wrapper mailbox._ProxyFile generic, probably because it was generic over AnyStr in typeshed. (Unchanged since mailbox.pyi was added in...
X Description: Feature or enhancement Proposal: #19425 made the internal file wrapper mailbox._ProxyFile generic, probably because it was generic over AnyStr in typeshed. (Unchanged since mailbox.pyi was added in...
Opengraph URL: https://github.com/python/cpython/issues/140808
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remove `_ProxyFile.__class_getitem__`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\n#19425 made the internal file wrapper `mailbox._ProxyFile` generic, probably because it was generic over `AnyStr` in typeshed. (Unchanged since `mailbox.pyi` was added in python/typeshed#3427. There was no discussion about it back then.)\n\n`_ProxyFile` does not need to be generic, as it's only used internally by `mailbox.py` and is always initialized with a binary file object (as returned by `open()`). In fact, this now complicates the stubs for mailbox.pyi, because we need to carry the generic-ness of this class through to other protocols. See python/typeshed#14950 for details.\n\nI suggest to remove `__class_getitem__` again, although this probably needs to go through the deprecation process, even though this is an internal class?\n\nCc @emmatyping @JelleZijlstra @AlexWaygood \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 --\u003e\n### Linked PRs\n* gh-140838\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/srittau","@type":"Person","name":"srittau"},"datePublished":"2025-10-30T20:06:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/140808/cpython/issues/140808"}
| 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:a7e96a4e-4a69-41a2-2c0c-5616b9a15258 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8378:31F0A2:1995A21:23E573F:696A4DF1 |
| html-safe-nonce | ecffe3915df05cc0abfcec0b1ca2098359bfe08c6b0e3df46c5849b123868bdb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mzc4OjMxRjBBMjoxOTk1QTIxOjIzRTU3M0Y6Njk2QTRERjEiLCJ2aXNpdG9yX2lkIjoiNTM3MTk1MDE2NDIxOTY3ODE5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3cf7ab0eebca72b471654eb91e26f7735219be3011940b22e7867ac3a0424227 |
| hovercard-subject-tag | issue:3572326686 |
| 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/140808/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b60f052ac5abe0bb72008e6079adc3def4624d4dd5039d5f9e756b91c6f3b166/python/cpython/issues/140808 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b60f052ac5abe0bb72008e6079adc3def4624d4dd5039d5f9e756b91c6f3b166/python/cpython/issues/140808 |
| og:image:alt | Feature or enhancement Proposal: #19425 made the internal file wrapper mailbox._ProxyFile generic, probably because it was generic over AnyStr in typeshed. (Unchanged since mailbox.pyi was added in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | srittau |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef |
| 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 | 63c426b30d262aba269ef14c40e3c817b384cd61 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width